Skip to content

Commit e83b758

Browse files
committed
ci: add trivy to ci workflow
1 parent 9f307f0 commit e83b758

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/ci.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,38 @@ jobs:
5555
env:
5656
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5757

58+
trivy:
59+
runs-on: ubuntu-latest
60+
61+
permissions:
62+
contents: read
63+
security-events: write
64+
actions: read
65+
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
- name: Setup Go
71+
uses: actions/setup-go@v5
72+
with:
73+
go-version-file: ./go.mod
74+
75+
- name: Download Go modules
76+
run: go mod download
77+
78+
- name: Run Trivy vulnerability scanner in repo mode
79+
uses: aquasecurity/[email protected]
80+
with:
81+
scan-type: "fs"
82+
format: "sarif"
83+
output: "trivy-results.sarif"
84+
85+
- name: Upload Trivy scan results to GitHub Security tab
86+
uses: github/codeql-action/upload-sarif@v3
87+
with:
88+
sarif_file: "trivy-results.sarif"
89+
5890
build:
5991
runs-on: ubuntu-latest
6092

0 commit comments

Comments
 (0)