Skip to content

Commit 6be0cc5

Browse files
authored
chore(CI): change cargo audit to run on a schedule (#1658)
## Motivation Currently, `cargo audit` checks are run on every push that modifies `Cargo.toml` or lockfiles. The intention behind this was to fail changes that introduce dependencies that have security advisories. However, it turns out that this is not actually the primary use-case for `cargo audit` runs. Typically, when a dependency of a `tracing` crate has a security advisory, this isn't newly introduced by a PR, but a new *advisory* that was just announced for a library we *already* depended on. In this case, this isn't a failure that should block any particular branch from merging; instead, it's a *new issue* that should block effected crates from being *released*. ## Solution This branch changes the audit workflow from running on pushes to running on a schedule (nightly). When using `actions-rs/audit-check` in a scheduled mode, it will automatically open new issues if any dependencies have security advisories (see https://github.com/actions-rs/audit-check#scheduled-audit for details). This means those advisories can be fixed separately while still allowing unrelated branches to pass CI. This is, IMO, a better workflow for handling security advisories. If we introduce release automation in the future, we should ensure that the release automation process checks that the crate being released has no open security advisory issues, and fails the *release* if any such issues are still open.
1 parent 226f605 commit 6be0cc5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

.github/workflows/audit.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Security audit
22
on:
3-
push:
4-
paths:
5-
- '**/Cargo.toml'
6-
- '**/Cargo.lock'
3+
schedule:
4+
- cron: '0 0 * * *'
75
jobs:
86
security_audit:
97
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)