fix(npm-audit-autofix): always run audit fix without --omit=dev#69
Merged
Conversation
Running npm audit fix --omit=dev removes all dev dependencies from node_modules without writing them back to package-lock.json, causing git diff to see no changes even when 920+ packages were removed. The audit step still respects omit_dev for read-only audit checks.
…h/setup-uv to v8.1.0
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
npm audit fixnow always runs without--omit=dev, regardless of theomit_devinput--omit=devflag onnpm audit fixcausednode_modulesto lose 900+ packages while leavingpackage-lock.jsonunchanged →git diff --quietsaw no changes even though a fix was neededomit_devinput still applies to the read-onlynpm auditcheck in the verify step (intended behavior)Root cause
npm audit fix --omit=devtreats--omit=devas an install-time filter: it removes dev dependencies fromnode_modulesin memory but does not rewritepackage-lock.json. So after the fix,git diff package-lock.jsonis always empty, and the workflow concludes "no changes" even when vulnerabilities were fixed.Running
npm audit fix(without--omit=dev) correctly rewritespackage-lock.jsonso the diff is detectable.Test plan
git diff package-lock.jsonnow shows changes after fixnpm audit --omit=devstill uses the flag in the verify step