Skip to content

Commit 137a580

Browse files
committed
add permissions to Trivy action
1 parent 5b6928f commit 137a580

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/trivy.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Trivy Scanner
2+
3+
permissions:
4+
contents: read
5+
security-events: write
26
on:
37
push:
48
branches:
@@ -16,15 +20,15 @@ jobs:
1620
- name: Run Trivy scanner in repo mode
1721
uses: aquasecurity/[email protected]
1822
with:
19-
scan-type: 'fs'
23+
scan-type: "fs"
2024
ignore-unfixed: true
21-
format: 'sarif'
22-
output: 'trivy-results.sarif'
23-
severity: 'CRITICAL,HIGH,UNKNOWN'
25+
format: "sarif"
26+
output: "trivy-results.sarif"
27+
severity: "CRITICAL,HIGH,UNKNOWN"
2428
scanners: vuln,secret,misconfig,license
2529
github-pat: ${{ secrets.GITHUB_TOKEN }}
2630

2731
- name: Upload Trivy scan results to GitHub Security tab
2832
uses: github/codeql-action/upload-sarif@v3
2933
with:
30-
sarif_file: 'trivy-results.sarif'
34+
sarif_file: "trivy-results.sarif"

0 commit comments

Comments
 (0)