File tree Expand file tree Collapse file tree 1 file changed +29
-18
lines changed Expand file tree Collapse file tree 1 file changed +29
-18
lines changed Original file line number Diff line number Diff line change 11name : Security Audit
22
33on :
4- pull_request :
4+ push :
55 paths :
66 - ' **/Cargo.toml'
77 - ' **/Cargo.lock'
8- merge_group :
9- push :
10- branches : [master]
8+ pull_request :
119 paths :
1210 - ' **/Cargo.toml'
1311 - ' **/Cargo.lock'
1412 schedule :
1513 # weekly
1614 - cron : ' 0 0 * * 0'
15+ workflow_dispatch :
1716
1817env :
1918 CARGO_TERM_COLOR : always
2019
2120permissions :
22- contents : read
23- security-events : write
24- issues : write
21+ contents : read
22+ security-events : write
23+ issues : write
2524
2625jobs :
2726 cargo-audit :
2827 name : RustSec Audit (vulnerabilities)
2928 runs-on : ubuntu-latest
3029 timeout-minutes : 15
30+
3131 steps :
3232 - name : Checkout code
33- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
33+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3434
3535 - name : Install Rust toolchain
36- uses : dtolnay/rust-toolchain@stable
36+ id : toolchain
37+ uses : dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
38+ with :
39+ toolchain : stable
3740
38- - name : Cache cargo registry/index/ target
39- uses : Swatinem/rust- cache@f13886b937689c021905a6b90929199931d60db1
41+ - name : Cache Cargo registry + target
42+ uses : actions/ cache@v4
4043 with :
41- cache-on-failure : true
44+ path : |
45+ ~/.cargo/bin
46+ ~/.cargo/registry/index
47+ ~/.cargo/registry/cache
48+ ~/.cargo/git/db
49+ target
50+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ steps.toolchain.outputs.cachekey }}
51+ restore-keys : |
52+ ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-
53+ ${{ runner.os }}-cargo-
4254
4355 - name : Install cargo-audit
4456 run : cargo install cargo-audit --locked
4557
46- - name : Run cargo audit (raw output — you will see this clearly)
47- run : cargo audit --deny warnings
48-
49- - name : Run cargo audit again for GitHub Security tab upload
50- uses : rustsec/audit-check@69366f33c96575abad1ee0dba8212ae3e3c0d700
58+ - name : Run cargo audit
59+ run : cargo audit --deny warnings
60+
61+ - name : Upload SARIF to GitHub Security tab
62+ uses : rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998
5163 with :
5264 token : ${{ secrets.GITHUB_TOKEN }}
5365 deny : warnings
54-
You can’t perform that action at this time.
0 commit comments