-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace FOSSA with Trivy for license scan (#4646)
- Loading branch information
Showing
5 changed files
with
42 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
TRIVY_VERSION: 0.44.1 | ||
|
||
name: License scan | ||
|
||
jobs: | ||
license: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
|
||
- name: Install Go deps | ||
run: go mod download | ||
|
||
- name: Install trivy | ||
run: | | ||
wget https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.deb | ||
sudo dpkg -i trivy_${TRIVY_VERSION}_Linux-64bit.deb | ||
- name: Create licence report artifact | ||
run: trivy fs --scanners license --skip-dirs ".github" --skip-files "package-lock.json,bin/scan-images/package-lock.json" . | tee license-report.txt | ||
|
||
- name: Upload licence report artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: license-report | ||
path: license-report.txt | ||
|
||
- name: Check for unknown licenses | ||
run: trivy fs --scanners license --skip-dirs ".github" --skip-files "package-lock.json,bin/scan-images/package-lock.json" --exit-code 1 --severity UNKNOWN . || echo "::warning::Unknown licenses found, please verify" | ||
|
||
- name: Check for forbidden licenses and fail | ||
run: trivy fs --scanners license --skip-dirs ".github" --skip-files "package-lock.json,bin/scan-images/package-lock.json" --exit-code 1 --severity CRITICAL,HIGH . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,3 @@ sbom/ | |
|
||
# ide | ||
.vscode | ||
|
||
# FOSSA | ||
fossa.debug.* | ||
fossa.telemetry.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters