fix(investigate): skip npm bump on yarn/pnpm repos instead of failing (breaks re-investigation loop) - #119
Open
toufali wants to merge 1 commit into
Open
fix(investigate): skip npm bump on yarn/pnpm repos instead of failing (breaks re-investigation loop)#119toufali wants to merge 1 commit into
toufali wants to merge 1 commit into
Conversation
Fixes #111 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the security-alert investigation workflow to avoid failing on repositories that don’t use npm’s package-lock.json, preventing repeated re-investigation loops when remediation can’t be performed.
Changes:
- Add an early check in the
Run npm audit fixstep to detect missingpackage-lock.json(yarn/pnpm repos) and skip the npm bump path gracefully. - Ensure the step sets
fixed=falseand exits successfully so downstream bump-PR creation is skipped and the workflow can still tag the alert as investigated.
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.
Fixes #111.
On repos without
package-lock.json(yarn/pnpm, e.g. mozilla/fxa), the npm-bump remediation runsnpm audit fix+npm-bump.shand fails (ENOLOCK/base64: package-lock.json: No such file). Because the remediate job errors, the alert is never taggedinvestigated/…, so the scheduled sweep re-investigates it every cycle — a runaway loop.This makes the
Run npm audit fixstep detect the absence ofpackage-lock.jsonand skip gracefully (fixed=false, exit 0). The bump-PR step is then skipped, the job succeeds, the alert gets tagged, and the loop stops. Full yarn support (resolutions) can come later; this stops the bleeding.🤖 Generated with Claude Code