summaryrefslogtreecommitdiffstats
path: root/.github/workflows/audit.yml
blob: 44b8d5963b81ea099698e573f569f616cc6d4b85 (plain)
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
# A routine check to see if there are any Rust-specific security vulnerabilities in the repo we should be aware of.

name: audit
on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * 1"
jobs:
  audit:
    timeout-minutes: 18
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

      - name: Set up Rust toolchain
        uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
        with:
          toolchain: stable

      - name: Enable Rust cache
        uses: Swatinem/rust-cache@378c8285a4eaf12899d11bea686a763e906956af # 2.7.3
        with:
          cache-targets: false
          cache-all-crates: true
          cache-on-failure: true

      - name: Install cargo-audit
        run: |
          cargo install cargo-audit --locked
          rm -rf ~/.cargo/registry || echo "no registry to delete"

      - uses: rustsec/audit-check@dd51754d4e59da7395a4cd9b593f0ff2d61a9b95 # v1.4.1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}