Skip to content

Automatically check licenses #4

Automatically check licenses

Automatically check licenses #4

Workflow file for this run

name: licenses
# TODO: trigger only on pyproject.toml changes
on:
pull_request:
types: [opened, synchronize]
push:
# Always run on push to main. The build cache can only be reused
# if it was saved by a run from the repository's default branch.
# The run result will be identical to that from the merge queue
# because the commit is identical, yet we need to perform it to
# seed the build cache.
branches:
- main
env:
HATCH_VERSION: 1.7.0
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- name: Install Python
uses: actions/setup-python@v4
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
python-version: '3.10'
- name: Get explicit and transitive dependencies
run: |
pip install .
pip freeze > requirements.txt
- name: Check python
id: license_check_report
uses: pilosus/action-pip-license-checker@v2
with:
requirements: 'requirements.txt'
fail: 'Copyleft'
exclude: '(?i)^(pylint|certifi|aio[-_]*).*'
- name: Print report
if: ${{ always() }}
run: echo "${{ steps.license_check_report.outputs.report }}"