build(ci): refuse a pull request that adds a vulnerable dependency - #92
Merged
Conversation
The NuGet and npm audits already fail the build on an advisory, but they ask 'is anything in the tree vulnerable today?' — which is answered after the change has landed. By then the bad version is on the branch and the choice is between reverting and rushing a fix. This asks 'does this pull request introduce one?' and answers before the merge is available. It diffs the dependency manifests of base and head, so it only reports what the change itself brings in; an advisory that was already there is not this job's business. fail-on-severity is moderate to match the audits that run after it. A gate laxer than the one behind it only lets something through to be rejected a minute later. Free on public repositories; needs the dependency graph, which is enabled.
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.
The NuGet and npm audits already fail the build on an advisory — but they ask "is anything in the tree vulnerable today?", which is answered after the change has landed. By then the bad version is on the branch and the choice is between reverting and rushing a fix.
This asks "does this pull request introduce one?" and answers before the merge button is available.
It diffs the dependency manifests of base and head, so it only ever reports what the change itself brings in. An advisory that was already there is not this job's business — which is what stops it becoming the kind of check people learn to ignore.
fail-on-severity: moderate, matching the audits that run after it. A gate laxer than the one behind it only lets something through to be rejected a minute later.comment-summary-in-pr: on-failure— including licence changes, which do not fail the job but are worth seeing in the diff. Two libraries here have already moved to commercial terms in a major version.Free on public repositories. Needs the dependency graph, which is enabled.