Skip to content

Commit 90b85b4

Browse files
committed
Test trivy for PRs
1 parent 7963d1d commit 90b85b4

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,19 @@ jobs:
1616
fetch-depth: '0'
1717

1818
- name: Build the Docker image
19-
run: docker build .
19+
run: docker build -t docker-netbootxyz:${{ github.sha }} .
20+
21+
- name: Run Trivy vulnerability scanner
22+
uses: aquasecurity/trivy-action@0.28.0
23+
with:
24+
image-ref: 'docker-netbootxyz:${{ github.sha }}'
25+
format: 'table'
26+
exit-code: '1'
27+
ignore-unfixed: true
28+
vuln-type: 'os,library'
29+
severity: 'CRITICAL,HIGH'
30+
31+
- name: Upload Trivy scan results to GitHub Security tab
32+
uses: github/codeql-action/upload-sarif@v3
33+
with:
34+
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)