-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
892e66c
commit be31f7f
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -54,6 +54,47 @@ jobs: | |
- name: Success | ||
run: echo "Success!" | ||
|
||
# Upload Trivy data | ||
trivy: | ||
if: success() || failure() # Does not run on cancelled workflows | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- tests | ||
|
||
steps: | ||
# Git Checkout | ||
- name: Checkout Code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1 | ||
with: | ||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: Run Trivy vulnerability scanner in repo mode | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: table | ||
exit-code: 1 | ||
severity: 'CRITICAL,HIGH,MEDIUM,LOW' | ||
|
||
- name: Run Trivy vulnerability scanner in repo mode | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH,MEDIUM,LOW' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: 'trivy-results.sarif' | ||
|
||
# Combine and upload coverage data | ||
coverage: | ||
if: success() || failure() # Does not run on cancelled workflows | ||
|