Make pip-audit in CI optional via configuration#31
Merged
Conversation
Make pip-audit in CI opt-in. Default (false) drops the pip-audit step from ci.yml and the pip-audit job from weekly-ci.yml -- rely on GitHub Dependabot alerts and run `just deps-audit` locally instead. When enabled, audit runs on the full locked set without filing an issue on failure; the failed workflow run is the signal.
The weekly pip-audit job re-ran against an unchanged lockfile and generated noisy issues whenever a new CVE was disclosed. Remove it entirely; the per-PR/push audit step (still gated by audit_in_ci) already covers actual dependency changes. Expand the option's help text to note that the audit only covers locked deps, which are irrelevant to downstream consumers.
The per-PR/push pip-audit step in ci.yml only fires when the lockfile changes, so it's cheap and accurate -- keep it always on. The weekly audit re-scans an unchanged lockfile against newly-disclosed CVEs and is the noisy one; gate that behind audit_in_ci instead. Drop its issue-creation step (failed workflow run is the signal).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change makes the
pip-auditjob in the weekly CI workflow optional by introducing a newaudit_in_ciconfiguration option incopier.yml. The pip-audit job and its associated failure notification logic are now conditionally included based on this setting.Key Changes
audit_in_ciboolean configuration option tocopier.yml(defaults tofalse)just deps-auditare always available alternativespip-auditjob in the workflow template with a conditional Jinja2 block ({%- if audit_in_ci %}...{%- endif %})permissions: issues: writedeclaration from the pip-audit job (no longer needed when job is optional)Implementation Details
The conditional wrapping ensures that when
audit_in_ciisfalse, the pip-audit job and all its associated infrastructure (including issue creation logic) are completely excluded from the generated workflow file. This allows projects to opt-in to this security check rather than having it enabled by default.https://claude.ai/code/session_01AhNeEPbEPMvNMkT268pd3n