Skip to content

Commit d84c4b3

Browse files
Yash Singhmmorel-35
authored andcommitted
Added trivy-scan
Signed-off-by: Yash Singh <[email protected]>
1 parent 03712a5 commit d84c4b3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/trivy-scan.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Trivy Security Scan
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["main"]
7+
8+
jobs:
9+
build:
10+
name: build
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Run Trivy vulnerability scanner
17+
uses: aquasecurity/trivy-action@1f0aa582c8c8f5f7639610d6d38baddfea4fdcee # master
18+
with:
19+
scan-type: 'fs'
20+
severity: 'CRITICAL,HIGH'
21+
format: 'sarif'
22+
output: 'trivy-results.sarif'
23+
24+
- name: Upload Trivy scan results to GitHub Security tab
25+
uses: github/codeql-action/upload-sarif@16964e90ba004cdf0cd845b866b5df21038b7723 # v2.2.6
26+
with:
27+
sarif_file: 'trivy-results.sarif'
28+
category: 'code'

0 commit comments

Comments
 (0)