Repository navigation
fix(ci-checks): retry the audit only on registry errors - #17
Merged
Merged
Conversation
The pnpm-audit step retried on any non-zero exit and, after three tries, reported "possibly a transient registry error". A real finding also exits non-zero, so a genuine advisory was retried twice and then shown as a registry problem. Capture the audit output and branch on it: a completed audit (its summary line is present) fails at once as a finding; a registry or network error (ERR_PNPM_AUDIT_BAD_RESPONSE such as the 410, fetch failures, ETIMEDOUT and similar) is retried up to three times; anything else fails at once with its exit code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vAMiNPVaNSZvobuesTQnA
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
pnpm-auditstep inapp-ci-checks.ymlretried on any non-zero exit and, after three tries, printed:A real finding also exits non-zero. So when an advisory appears, the job runs the same audit three times, prints the same vulnerability table three times, and then blames the registry. That is what apps-invest#341 and apps-management#1298 showed on 2026-09-29 for GHSA-3wwx-pv8p-q78v (undici
>=7.28.0 <7.29.1), and it reads like a flake to anyone scanning the last line.What changes
The step now captures the audit output and decides from it:
N vulnerabilities found, or npm'sN vulnerabilities (/N moderate severity vulnerability)Dependency audit found vulnerabilities at or above the audit level (see the report above)ERR_PNPM_AUDIT_BAD_RESPONSE(the 410),ERR_PNPM_AUDIT_ENDPOINT_NOT_EXISTS,ERR_PNPM_META_FETCH_FAIL,ERR_PNPM_FETCH_429/5xx,ETIMEDOUT,ECONNRESET,ECONNREFUSED,EAI_AGAIN,ENOTFOUND, npmcode E410/E429/E5xxAudit registry request still failing after 3 attempts (see pnpm/pnpm#11265)Audit command failed (exit N) without a registry error; not retryingFindings are checked first: a completed audit means the registry answered, so it is never retried. The step keeps its exit code instead of forcing
1. The full audit output is still printed on every attempt.audit-commandand its default are unchanged, so no caller changes.Verification
actionlint(with shellcheck) andyamllint(relaxed, line-length disabled) clean.sh -eagainst five simulated commands: clean (exit 0), findings (exit 1 at once, no retry), a 410 every time (3 attempts, registry message), a 410 that recovers on attempt 2 (passes), and an unrelated error (exit 2 at once, no retry).audit-command(pnpm dlx pnpm@11.13.0 ... audit --audit-level moderate) run through the new step against apps-invest's current lockfile:4 vulnerabilities found, reported as findings on the first attempt.It does not fix the advisory itself. The apps pin
undicito7.29.0inpnpm.overrides; bumping that is for each app.🤖 Generated with Claude Code
https://claude.ai/code/session_014vAMiNPVaNSZvobuesTQnA
Generated by Claude Code