File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Cargo Audit
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ audit :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Install Rust
17+ uses : actions-rs/toolchain@v1
18+ with :
19+ toolchain : stable
20+ override : true
21+
22+ - name : Install cargo-audit
23+ run : cargo install cargo-audit
24+
25+ - name : Run cargo audit
26+ run : cargo audit --json > audit.json || true
27+
28+ - name : Check for critical vulnerabilities
29+ run : |
30+ CRITICAL_COUNT=$(jq '[.vulnerabilities.list[] | select(.advisory.severity == "critical")] | length' audit.json)
31+ echo "Found $CRITICAL_COUNT critical vulnerabilities"
32+ if [ "$CRITICAL_COUNT" -gt 0 ]; then
33+ echo "Critical vulnerabilities detected!"
34+ exit 1
35+ fi
You can’t perform that action at this time.
0 commit comments