Skip to content

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
mainfrom
fix/skip-npm-bump-on-yarn
Open

fix(investigate): skip npm bump on yarn/pnpm repos instead of failing (breaks re-investigation loop)#119
toufali wants to merge 1 commit into
mainfrom
fix/skip-npm-bump-on-yarn

Conversation

@toufali

@toufali toufali commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes #111.

On repos without package-lock.json (yarn/pnpm, e.g. mozilla/fxa), the npm-bump remediation runs npm audit fix + npm-bump.sh and fails (ENOLOCK / base64: package-lock.json: No such file). Because the remediate job errors, the alert is never tagged investigated/…, so the scheduled sweep re-investigates it every cycle — a runaway loop.

This makes the Run npm audit fix step detect the absence of package-lock.json and 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

Fixes #111

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 fix step to detect missing package-lock.json (yarn/pnpm repos) and skip the npm bump path gracefully.
  • Ensure the step sets fixed=false and exits successfully so downstream bump-PR creation is skipped and the workflow can still tag the alert as investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(investigate): remediation is npm-only and fails on yarn repos (causes re-investigation loop)

2 participants