Skip to content

Commit 4b88a5f

Browse files
committed
fix(audit-workflow): update audit workflow
- remove master branch filter - fix invalid pinned SHA - replace Swatinem/rust-cache, actions/cache and dtolnay/rust-toolchain actions
1 parent 956b717 commit 4b88a5f

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

.github/workflows/audit.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,50 @@
11
name: Security Audit
22

33
on:
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

1817
env:
1918
CARGO_TERM_COLOR: always
2019

2120
permissions:
22-
contents: read
23-
security-events: write
24-
issues: write
21+
contents: read
22+
security-events: write
23+
issues: write
2524

2625
jobs:
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
34-
35-
- name: Install Rust toolchain
36-
uses: dtolnay/rust-toolchain@stable
37-
38-
- name: Cache cargo registry/index/target
39-
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
34+
- name: Install Rust toolchain and configure cache
35+
uses: actions-rust-lang/setup-rust-toolchain@v1
4036
with:
41-
cache-on-failure: true
37+
toolchain: stable
38+
cache: true
4239

4340
- name: Install cargo-audit
4441
run: cargo install cargo-audit --locked
4542

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
43+
- name: Run cargo audit
44+
run: cargo audit --deny warnings
45+
46+
- name: Upload SARIF to GitHub Security tab
47+
uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998
5148
with:
5249
token: ${{ secrets.GITHUB_TOKEN }}
5350
deny: warnings
54-

0 commit comments

Comments
 (0)