name: Security audit
on:
push:
branches: [ "main" ]
paths: [ "Cargo.lock", "fuzz/Cargo.lock", ".github/workflows/audit.yml" ]
pull_request:
branches: [ "main" ]
paths: [ "Cargo.lock", "fuzz/Cargo.lock", ".github/workflows/audit.yml" ]
schedule:
- cron: '0 4 * * 1'
workflow_dispatch:
workflow_call:
inputs:
caller-run-id:
description: >
Run ID of the calling workflow. `github.event_name` cannot be used to
detect a called run: inside a called workflow the github context is the
caller's, so it is never 'workflow_call'.
required: false
type: string
default: ""
ref:
description: >
Exact commit to check out. Empty (the normal push/PR case) uses the
triggering ref; a release caller pins its resolved release commit.
required: false
type: string
default: ""
permissions:
contents: read
concurrency:
group: audit-${{ inputs.caller-run-id || github.ref }}
cancel-in-progress: ${{ !inputs.caller-run-id }}
jobs:
audit:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Install cargo-audit
uses: taiki-e/install-action@7572810d7dd469b651bb7793945692cf78da5dd7 with:
tool: cargo-audit@0.22.2
- name: Audit dependencies
run: |
cargo audit
cargo audit --file fuzz/Cargo.lock