{"id":17350488,"url":"https://github.com/pilosus/action-pip-license-checker","last_synced_at":"2025-04-09T18:17:22.889Z","repository":{"id":40716367,"uuid":"384743248","full_name":"pilosus/action-pip-license-checker","owner":"pilosus","description":"GitHub Action for license compliance: Python, JavaScript, iOS, Android and more.","archived":false,"fork":false,"pushed_at":"2025-03-10T18:09:53.000Z","size":100,"stargazers_count":50,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T18:17:17.109Z","etag":null,"topics":["actions","continuous-integration","dependency-management","github-actions","license","license-compliance","license-management"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pilosus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"pilosus"}},"created_at":"2021-07-10T16:31:55.000Z","updated_at":"2025-03-13T14:30:18.000Z","dependencies_parsed_at":"2024-01-13T12:49:31.503Z","dependency_job_id":"84abd43b-5fec-4022-a55d-832ac67af65d","html_url":"https://github.com/pilosus/action-pip-license-checker","commit_stats":{"total_commits":65,"total_committers":2,"mean_commits":32.5,"dds":"0.16923076923076918","last_synced_commit":"2d1c4b89e9c2e4dd35ebc60217d739e3e3135f51"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Faction-pip-license-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Faction-pip-license-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Faction-pip-license-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Faction-pip-license-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilosus","download_url":"https://codeload.github.com/pilosus/action-pip-license-checker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085321,"owners_count":21045139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","continuous-integration","dependency-management","github-actions","license","license-compliance","license-management"],"created_at":"2024-10-15T17:07:07.860Z","updated_at":"2025-04-09T18:17:22.868Z","avatar_url":"https://github.com/pilosus.png","language":"Clojure","funding_links":["https://github.com/sponsors/pilosus"],"categories":["Software"],"sub_categories":["Tools \u0026 libs"],"readme":"# GitHub Action for detecting license names and types\n\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/pilosus/action-pip-license-checker?label=latest%20stable%20version)\n\nDetect license names and types for Python PyPI packages. Identify\nlicense types for given license names obtained by third-party\ntools. Great coverage of free/libre and open source licenses of all\ntypes:\n[public domain](https://en.wikipedia.org/wiki/Public-domain-equivalent_license),\n[permissive](https://en.wikipedia.org/wiki/Permissive_software_license),\n[copyleft](https://en.wikipedia.org/wiki/Copyleft).\n\nSupported formats:\n\n- **Python**: packages or `requirements.txt` (detect license name and license type)\n- **JavaScript**: CSV files generated by [license-checker](https://www.npmjs.com/package/license-checker) (detect license type)\n- **iOS**: Apple Plist files generated by [CocoaPods Acknowledgements plugin](https://github.com/CocoaPods/cocoapods-acknowledgements) (detect license type)\n- **Android**: JSON files generated by [Gradle License Plugin](https://github.com/jaredsburrows/gradle-license-plugin) (detect license type)\n- **Other**: CSV files with package name and license name columns (detect license type).\n\nBased on [pip-license-check](https://github.com/pilosus/pip-license-checker) command-line tool.\n\n## Usage examples\n\n### Check all Python packages including transitive dependencies\n\n```yaml\njobs:\n  license_check:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout the code\n      uses: actions/checkout@v2\n      with:\n        fetch-depth: 0\n    - name: Setup Python\n      uses: actions/setup-python@v2\n      with:\n        python-version: '3.6'\n    - name: Get explicit and transitive dependencies\n      run: |\n        pip install -r requirements.txt\n        pip freeze \u003e requirements-all.txt\n    - name: Check python\n      id: license_check_report\n      uses: pilosus/action-pip-license-checker@v2\n      with:\n        requirements: 'requirements-all.txt'\n        fail: 'Copyleft'\n        exclude: '(?i)^(pylint|aio[-_]*).*'\n    - name: Print report\n      if: ${{ always() }}\n      run: echo \"${{ steps.license_check_report.outputs.report }}\"\n```\n\n### Check CSV file generated by JavaScript `license-checker` package\n\n```yaml\njobs:\n  license_check:\n    runs-on: ubuntu-lastest\n    steps:\n    ...\n    - name: Check license-checker CSV file without headers\n      id: license_check_report\n      uses: pilosus/action-pip-license-checker@v2\n      with:\n        external: 'npm-license-checker.csv'\n        external-format: 'csv'\n        external-options: '{:skip-header true}'\n        fail: 'StrongCopyleft,NetworkCopyleft,Other,Error'\n        fails-only: true\n        exclude: 'your-company-name.*'\n        exclude-license: '(?i)copyright'\n        totals: true\n        verbose: 1\n        github-token: ${{ secrets.OAUTH_TOKEN_GITHUB }}\n        ...\n```\n\n### Check JSON file generated by Android `gradle-license-plugin` package\n\n```yaml\njobs:\n  license_check:\n    runs-on: ubuntu-latest\n    steps:\n    ...\n    - name: Check gradle-license-plugin JSON file\n      id: license_check_report\n      uses: pilosus/action-pip-license-checker@v2\n      with:\n        external: 'gradle-license-plugin.json'\n        external-format: 'gradle'\n        external-options: '{:fully-qualified-names false}'\n        fail: 'StrongCopyleft,NetworkCopyleft,Other,Error'\n        fails-only: true\n        exclude: 'your-company-name.*'\n        totals: true\n        ...\n```\n\n### Check Plist file generated by iOS `cocoapods-acknowledgements` package\n\n```yaml\njobs:\n  license_check:\n    runs-on: ubuntu-latest\n    steps:\n    ...\n    - name: Check cocoapods-acknowledgements Plist file\n      id: license_check_report\n      uses: pilosus/action-pip-license-checker@v2\n      with:\n        external: 'cocoapods-acknowledgements.plist'\n        external-format: 'cocoapods'\n        external-options: '{:skip-header true :skip-footer true}'\n        fail: 'StrongCopyleft,NetworkCopyleft,Other,Error'\n        fails-only: true\n        exclude: 'your-company-name.*'\n        totals: true\n        ...\n```\n\n### Generate a report as a downloadable file\n\nBy using the `report-format` input field and a third-party\n[actions/upload-artifact](https://github.com/actions/upload-artifact)\naction you can save the report as a file and download it. In the\nfollowing example the license check report is generated in\n`json-pretty` format and saved as a GitHub workflow artifact:\n\n```yaml\njobs:\n  license_check:\n    runs-on: ubuntu-latest\n    steps:\n    ...\n      - name: Check licenses\n        id: license_check_report\n        uses: pilosus/action-pip-license-checker@5b5956a1093c68ebac6ff53c8427790d04ee5c26\n        with:\n          external: 'licenses.csv'\n          external-format: 'csv'\n          external-options: '{:skip-header false :package-column-index 0 :license-column-index 2}'\n          report-format: 'json-pretty'\n          formatter: '%-65s %-65s %-20s %-40s'\n          totals: true\n          headers: true\n          fail: 'StrongCopyleft,NetworkCopyleft,Other,Error'\n          verbose: 1\n      - name: Save report\n        if: ${{ always() }}\n        run: echo \"${{ steps.license_check_report.outputs.report }}\" \u003e license-report.json\n      - name: Upload artifact\n        if: ${{ always() }}\n        uses: actions/upload-artifact@v3\n        with:\n          name: license-report\n          path: license-report.json\n```\n\nThen the report can be downloaded as an [archived\nartifact](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts).\n\n### Supported file formats and their options\n\nSee the [documentation](https://github.com/pilosus/pip-license-checker#external-file-formats).\n\n### Integration examples\n\n- [Explicit dependencies only](https://github.com/pilosus/piny/pull/134/files)\n  and its [action run](https://github.com/pilosus/piny/runs/3051101459?check_suite_focus=true)\n- [Explicit and transitive dependencies](https://github.com/pilosus/piny/pull/140/files)\n  and its [action run](https://github.com/pilosus/piny/runs/3330267456?check_suite_focus=true)\n- [Third-party license list in CSV file](https://github.com/pilosus/piny/pull/141/files)\n  and its [action run](https://github.com/pilosus/piny/runs/3333900660?check_suite_focus=true)\n\n\n## Inputs\n\nAll the inputs correspond with `pip-license-checker`'s\n[options](https://github.com/pilosus/pip-license-checker#help).\n\n### `requirements`\n\nPath to requirements file, e.g. `requirements.txt`. Separate multiple files with comma: `file1.txt,file2.txt,file3.txt`.\n\n### `external`\n\nPath to an external file. Separate multiple files with comma: `file1.csv,file2.csv,file3.csv`.\n\nUsed to check license types for the list of given packages with their\nlicenses.\n\nAllows to check license types for JavaScript, Java or any other\ndependencies with known licenses in one of the supported file formats.\n\n### `external-format`\n\nExternal file format: `csv`, `cocoapods`, `gradle`, etc.\n\nSee the full list of supported formats and their documentation\n[here](https://github.com/pilosus/pip-license-checker#external-file-formats).\n\n### `external-options`\n\nString of options in [EDN format](http://edn-format.org/).\n\nSee the [documentation](https://github.com/pilosus/pip-license-checker#external-file-options) for more details.\n\n### `fail`\n\nReturn non-zero exit code if license type provided via the input is found.\nUse one of the following values:\n\n- `WeakCopyleft`\n- `StrongCopyleft`\n- `NetworkCopyleft`\n- `Copyleft` (includes all of above types of copyleft)\n- `Permissive`\n- `Other` (EULA, other non standard licenses)\n- `Error` (package or its license not found)\n\nSeparate multiple license types with comma: `Copyleft,Other,Error`.\n\n### `fails-only`\n\nPrint only packages of license types specified with `fail` input.\n\n### `exclude`\n\nRegular expression (PCRE) to exclude matching packages from the check.\n\n### `exclude-license`\n\nRegular expression (PCRE) to exclude matching license names from the check.\n\n### `pre`\n\nInclude pre-release and development versions.\n\n### `totals`\n\nPrint totals for license types found. Totals appended after the detailed list of the packages.\n\n### `totals-only`\n\nPrint only totals for license types found, do not include the detailed list of the packages checked.\n\n### `headers`\n\nPrint table headers for detailed list of the packages.\n\n### `report-format`\n\nReport format: `stdout` (default), `json`, `json-pretty`, `csv`.\n\n### `formatter`\n\nPrintf-style formatter string for report formatting. Default value is `%-35s %-55s %-30s`.\n\n### `github-token`\n\nGitHub OAuth Token to increase rate-limits when requesting GitHub\nAPI. Recommended to keep a token as a GitHub secret.\n\n### `verbose`\n\nOutput verbosity level:\n\n- 0 (or `false`, default) - no verbosity\n- 1 (or `true`) - errors only\n- 2 - errors, info\n- 3 - errors, info, debug\n\nLevels 1 and higher add a `Misc` column to a report table.\n\n## Outputs\n\n### `report`\n\nLicense check report.\n\n## Contributing\n\nSee [Contributing guide](https://github.com/pilosus/action-pip-license-checker/blob/main/CONTRIBUTING.md).\n\n## Disclaimer\n\nSoftware is provided on an \"as-is\" basis and makes no warranties\nregarding any information provided through it, and disclaims liability\nfor damages resulting from using it. Using the software does not\nconstitute legal advice nor does it create an attorney-client\nrelationship.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilosus%2Faction-pip-license-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilosus%2Faction-pip-license-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilosus%2Faction-pip-license-checker/lists"}