File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Security Scan
2+
3+ on :
4+ pull_request :
5+ branches : [main]
6+ push :
7+ branches : [main]
8+
9+ jobs :
10+ trivy-scan :
11+ name : Trivy Security Scan
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : read
15+ security-events : write
16+ actions : read
17+
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+
22+ - name : Set up Python
23+ uses : actions/setup-python@v4
24+ with :
25+ python-version : ' 3.12'
26+
27+ - name : Install dependencies
28+ run : |
29+ python -m pip install --upgrade pip
30+ python -m pip install -e ".[dev]"
31+
32+ - name : Run Trivy vulnerability scan
33+ uses : aquasecurity/trivy-action@0.28.0
34+ with :
35+ scan-type : ' fs'
36+ scan-ref : ' .'
37+ format : ' sarif'
38+ output : ' trivy-results.sarif'
39+ severity : ' CRITICAL,HIGH,MEDIUM,LOW'
40+ exit-code : ' 0'
41+
42+ - name : Check for critical and high vulnerabilities
43+ uses : aquasecurity/trivy-action@0.28.0
44+ with :
45+ scan-type : ' fs'
46+ scan-ref : ' .'
47+ format : ' table'
48+ severity : ' CRITICAL,HIGH'
49+ exit-code : ' 1'
50+
51+ - name : Upload Trivy scan results to GitHub Security tab
52+ uses : github/codeql-action/upload-sarif@v3
53+ if : always()
54+ with :
55+ sarif_file : ' trivy-results.sarif'
56+ category : ' trivy-security-scan'
You can’t perform that action at this time.
0 commit comments