-
Notifications
You must be signed in to change notification settings - Fork 131
Closed as not planned
Closed as not planned
Copy link
Labels
Description
My expectation is that adding a license to allow-dependencies-licenses
should prevent it from being populated in the invalid-license-changes
output however that doesn't seem to be the case with the action below. Is this a bug or are my expectations for the output incorrect? If I misunderstood, how do I manually approve unlicensed packages so that they do not fail the job
dependency-license-review:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: "Dependency Review"
id: review
# TODO: Replace this with the latest release once https://github.com/actions/dependency-review-action/pull/761 is merged.
uses: actions/dependency-review-action@49fbbe0acb033b7824f26d00b005d7d598d76301
with:
allow-licenses: Apache-2.0, BSD-2-Clause, BSD-3-Clause, CC0-1.0, ISC, MIT, MIT-0, MPL-2.0
allow-dependencies-licenses: "pkg:golang/github.com/pelletier/go-toml/v2, pkg:golang/gopkg.in/DataDog/[email protected]"
license-check: true
vulnerability-check: false
- name: "Report"
# make sure this step runs even if the previous failed
if: always()
shell: bash
env:
VULNERABLE_CHANGES: ${{ steps.review.outputs.invalid-license-changes }}
run: |
fields=( "unlicensed" "unresolved" "forbidden" )
for field in "${fields[@]}"; do
# Use jq to check if the array is not empty
if [[ $(echo "$VULNERABLE_CHANGES" | jq ".${field} | length") -ne 0 ]]; then
echo "$VULNERABLE_CHANGES" | jq
exit 1
fi
done
echo "No incompatible licenses detected"
{
"unlicensed": [
{
"change_type": "added",
"manifest": "go.mod",
"ecosystem": "gomod",
"name": "gopkg.in/DataDog/dd-trace-go.v1",
"version": "1.63.1",
"package_url": "pkg:golang/gopkg.in/DataDog/[email protected]",
"license": null,
"source_repository_url": null,
"scope": "runtime",
"vulnerabilities": []
}
],
"unresolved": [],
"forbidden": []
}