Skip to content

Commit 67d9bf4

Browse files
committed
On CI, have cargo deny allow RUSTSEC-2025-0021 via gix-testtools
This splits the `EmbarkStudios/cargo-deny-action` step in `cargo-deny-advisories` into two such steps: - Scan the workspace except prune `gix-testtools` and everything reachable through it (following it neither as a root, nor when it is found as dev dependency of another crate). This doesn't get to its obsolete dependencies, while still ensuring that nothing in the workspace *except* what we reach through `gix-testtools` is affected by RUSTSEC-2025-0021. - Scan the whole workspace, including `gix-testtools` and all its dependencies, including the obsolete version of `gix-features` that is affected by RUSTSEC-2025-0021. But ignore that advisory. To support this, steps are added to install the `yq`-associated `tomlq` command and use it to produce the modified configuration file for the second scan in a way that shouldn't break under any changes to comments, spacing, style, or ordering in `deny.toml`.
1 parent 7ad29e6 commit 67d9bf4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,28 @@ jobs:
344344

345345
steps:
346346
- uses: actions/checkout@v4
347-
- uses: EmbarkStudios/cargo-deny-action@v2
347+
- name: Install tomlq
348+
run: |
349+
# The runner already has the `yq` command but not its associated `tomlq` command.
350+
sudo apt-get update
351+
sudo apt-get install yq
352+
- name: Strict check, but omit gix-testtools
353+
uses: EmbarkStudios/cargo-deny-action@v2
354+
with:
355+
command: check advisories
356+
arguments: --workspace --all-features --exclude gix-testtools
357+
- name: Configure less strict check
358+
run: |
359+
filter='.advisories.ignore += [
360+
{ id: "RUSTSEC-2025-0021", reason: "gix-testtools can’t upgrade from old gix-features yet" }
361+
]'
362+
tomlq "$filter" deny.toml --toml-output > deny-but-ignore-RUSTSEC-2025-0021.toml
363+
- name: Less strict check, but include gix-testtools
364+
uses: EmbarkStudios/cargo-deny-action@v2
348365
with:
349366
command: check advisories
350367
arguments: --workspace --all-features
368+
command-arguments: --config deny-but-ignore-RUSTSEC-2025-0021.toml
351369

352370
cargo-deny:
353371
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)