-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.22 KB
/
ci-cargo-audit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# CI job for scanning Cargo dependencies for vulnerabilities and report/fail job based on criticality.
# Critically vulnerable dependencies with fix available will mark the run as failed (X)
name: Rust Cargo Audit
on:
push:
branches: master
pull_request:
# Allowing manual runs with ability to choose branch
workflow_dispatch:
# Optimisation option by targeting direct paths to only scan when there are changes to dependencies in the push/PR
# push:
# paths:
# - 'Cargo.toml'
# - 'Cargo.lock'
# pull_request:
# paths:
# - 'Cargo.toml'
# - 'Cargo.lock'
# Example of running scheduled scans at 6AM UTC every Monday to regularly check for vulnerable dependencies
# schedule:
# - cron: '0 6 * * 1'
# Run the job
jobs:
Cargo-audit:
name: Cargo Vulnerability Scanner
runs-on: ubuntu-latest
steps:
# Check out GitHub repo
- uses: actions/checkout@v2
# Install cargo audit
- name: Install Cargo Audit
uses: actions-rs/[email protected]
with:
crate: cargo-audit
version: latest
# Run cargo audit using args from .cargo/audit.toml (ignores, etc.)
- name: Run Cargo Audit
run: cargo audit -c always