Skip to content

Commit d16ff9e

Browse files
authored
Add Trivy scanning (#219)
* Add Trivy scanning * Update severity * fix: Upload scan results to security tab
1 parent 5b8832d commit d16ff9e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/security.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Security
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-20.04
11+
permissions:
12+
contents: read
13+
security-events: write
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Trivy scan
19+
uses: aquasecurity/[email protected]
20+
with:
21+
scan-type: 'fs'
22+
format: 'sarif'
23+
output: 'trivy-results.sarif'
24+
severity: 'MEDIUM,HIGH,CRITICAL'
25+
exit-code: '0'
26+
ignore-unfixed: false
27+
28+
- name: Update Security tab
29+
uses: github/codeql-action/upload-sarif@v3
30+
with:
31+
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)