File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ # Uses Trivy to scan every pull request, rejecting those with severe, fixable vulnerabilities.
2+ # Scans on PR to main and weekly with same behavior.
3+ name : Trivy
4+
5+ on :
6+ pull_request :
7+ branches :
8+ - main
9+ push :
10+ branches :
11+ - main
12+ # Scan schedule is same as codeql-analysis job.
13+ schedule :
14+ - cron : ' 10 18 * * 2'
15+
16+ jobs :
17+ scan :
18+ permissions :
19+ # for github/codeql-action/upload-sarif to upload SARIF results
20+ security-events : write
21+
22+ runs-on : ubuntu-latest
23+
24+ steps :
25+ - uses : actions/checkout@v3
26+
27+ # Run trivy and log detected and fixed vulnerabilities
28+ # This report should match the uploaded code scan report below
29+ # and is a convenience/redundant effort for those who prefer to
30+ # read logs and/or if anything goes wrong with the upload.
31+ - name : Log all detected vulnerabilities
32+ uses : aquasecurity/trivy-action@master
33+ with :
34+ scan-type : fs
35+ hide-progress : true
36+ ignore-unfixed : true
37+
38+ # Upload actionable results to the GitHub Security tab.
39+ # Pull request checks fail according to repository settings.
40+ # - https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github
41+ # - https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning
42+ - name : Report actionable vulnerabilities
43+ uses : aquasecurity/trivy-action@master
44+ with :
45+ scan-type : fs
46+ ignore-unfixed : true
47+ format : ' sarif'
48+ output : ' trivy-results.sarif'
49+
50+ - name : Upload Trivy scan results to GitHub Security tab
51+ uses : github/codeql-action/upload-sarif@v2
52+ with :
53+ sarif_file : ' trivy-results.sarif'
You can’t perform that action at this time.
0 commit comments