-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add cargo-audit weekly + PR-on-Cargo-touch #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,46 @@ | ||||||||||||||||||||||||||
| name: "cmtraceopen-web: cargo-audit" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Runs `cargo audit` (via the official rustsec/audit-check action, which | ||||||||||||||||||||||||||
| # wraps the rustsec/advisory-db) against Cargo.lock. Catches new RustSec | ||||||||||||||||||||||||||
| # advisories without waiting for Dependabot to file an alert. | ||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||
| # Triggers: | ||||||||||||||||||||||||||
| # - Weekly cron (Monday 13:00 UTC ≈ 09:00 ET) so we get a regular baseline | ||||||||||||||||||||||||||
| # even on quiet weeks. | ||||||||||||||||||||||||||
| # - workflow_dispatch for ad-hoc runs. | ||||||||||||||||||||||||||
| # - pull_request that touches Cargo.toml or Cargo.lock — fails the PR if | ||||||||||||||||||||||||||
| # a dep bump pulls in a known-vulnerable crate. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||
| - cron: "0 13 * * 1" | ||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||
| - "**/Cargo.toml" | ||||||||||||||||||||||||||
| - "**/Cargo.lock" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||
| # rustsec/audit-check posts annotations + an issue comment on advisories. | ||||||||||||||||||||||||||
| issues: write | ||||||||||||||||||||||||||
| # Required so the action can write Check Run annotations on PRs. | ||||||||||||||||||||||||||
| checks: write | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||
| audit: | ||||||||||||||||||||||||||
| name: cargo audit | ||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||
| # cmtraceopen is a git submodule at ./cmtraceopen; the root Cargo.lock | ||||||||||||||||||||||||||
| # path-depends on `./cmtraceopen/crates/cmtraceopen-parser`, so without | ||||||||||||||||||||||||||
| # the submodule cargo can't resolve the lockfile. | ||||||||||||||||||||||||||
| - name: Checkout (with submodules) | ||||||||||||||||||||||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| submodules: true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Run cargo-audit | ||||||||||||||||||||||||||
| uses: rustsec/audit-check@v2 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||
|
Comment on lines
+43
to
+46
|
||||||||||||||||||||||||||
| - name: Run cargo-audit | |
| uses: rustsec/audit-check@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| - name: Run cargo-audit (root Cargo.lock) | |
| run: cargo audit --file Cargo.lock | |
| - name: Run cargo-audit (cmtrace-wasm/Cargo.lock) | |
| run: cargo audit --file cmtrace-wasm/Cargo.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustsec/audit-checkis referenced by tag (@v2) rather than being pinned to a commit SHA. Other workflows in this repo pin actions to a full SHA for supply-chain integrity; please pin this action similarly (and keep the# vX.Y.Zcomment).