Skip to content

Commit a06127f

Browse files
committed
feat: Add GitHub Actions workflow for security scanning using govulncheck and Trivy.
1 parent 873be84 commit a06127f

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/security.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Security Scan
2+
3+
on:
4+
push:
5+
branches: [ main, devenv-manager ]
6+
pull_request:
7+
branches: [ main, devenv-manager ]
8+
schedule:
9+
# Run weekly on Mondays at 9am UTC
10+
- cron: '0 9 * * 1'
11+
12+
jobs:
13+
govulncheck:
14+
name: Go Vulnerability Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.24'
22+
23+
- name: Run govulncheck
24+
uses: golang/govulncheck-action@v1
25+
with:
26+
go-version-input: '1.24'
27+
go-package: './...'
28+
29+
trivy:
30+
name: Trivy Security Scan
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Run Trivy vulnerability scanner
36+
uses: aquasecurity/trivy-action@master
37+
with:
38+
scan-type: 'fs'
39+
scan-ref: '.'
40+
format: 'sarif'
41+
output: 'trivy-results.sarif'
42+
43+
- name: Upload Trivy results to GitHub Security
44+
uses: github/codeql-action/upload-sarif@v3
45+
with:
46+
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)