CICD-371 · License compliance scanning
Encyclopedia · Advanced security and compliance · All snippets
Previous · CICD-370 · Next · CICD-372
1. Where it fits
- Placement CI license gate.
- Prerequisites reviewed policies, a short-lived CI identity, and synthetic or approved test inputs.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
pip-licenses --format=json --output-file=licenses.json
jq -e 'all(.[]; .License != "UNKNOWN")' licenses.json3. How it works
The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.
4. Verify the result
Resolve unknown licenses and compare against your approved allowlist after normalizing SPDX identifiers.
Validation syntax-validated (Bash parse). Status definitions.