Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Github action to check allowed licenses on pip packages

License

Notifications You must be signed in to change notification settings

adjust/check-pip-licenses-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Check pip licenses action

This actions checks for allowed licenses on pip packages.

Usage:

You'll need to setup youre python evnironment on your pipeline and install yor requirements for this adjust/check-pip-licenses-action to check you licenses.

    - uses: actions/checkout@v3

    - name: Set up Python
      uses: actions/setup-python@v4.2.0
      with:
        python-version: 3.9.6

    - uses: actions/cache@v3
      id: cache-venv
      with:
        path: ${{ env.pythonLocation }}
        key: ${{ env.pythonLocation }}-${{ hashFiles('requirements**.txt') }}

    - name: Install dependencies
      if: steps.cache-venv.outputs.cache-hit != 'true'
      run: |
        python -m pip install -U pip setuptools
        python -m pip install -r requirements-dev.txt

    - uses: adjust/check-pip-licenses-action@v1.0.0

Notes

  • The licenses are based on a hardcoded constant called ALLOWED_LICENSES, meaning we only have a way of whiitelisting packages directly on code.