From f08bcd9b12e3d8bdb490ac9fae8e0a5b9e409870 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 23 Feb 2023 19:31:36 -0600 Subject: [PATCH] chore(ci): Enforce cargo-deny in CI We skip failure for advisories on the step, rather than the job, to not distract contributors in thinking they broke something as that bubbles up into the PR job summary. --- .github/workflows/audit.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/audit.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 00000000000..14e35b7b379 --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,30 @@ +name: Security audit + +permissions: + contents: read + +on: + pull_request: + paths: + - '**/Cargo.toml' + - '**/Cargo.lock' + push: + branches: + - master + +jobs: + cargo_deny: + runs-on: ubuntu-latest + strategy: + matrix: + checks: + - advisories + - bans licenses sources + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + # Prevent sudden announcement of a new advisory from failing ci: + continue-on-error: ${{ matrix.checks == 'advisories' }} + with: + command: check ${{ matrix.checks }} + rust-version: stable