CI: retry npm audit on registry errors only
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (pull_request) Successful in 17s
CI / Lint (eslint) (pull_request) Successful in 21s
CI / Security (npm audit) (pull_request) Successful in 7s
CI / Integration (api) (pull_request) Successful in 1m23s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m48s
CI / UI screenshots (before/after) (pull_request) Successful in 6s
CI / Lint (eslint) (push) Successful in 19s
CI / Test (jest) (push) Successful in 16s
CI / Security (npm audit) (push) Successful in 8s
CI / UI (playwright) (pull_request) Successful in 2m5s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / Integration (api) (push) Successful in 1m23s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m53s
CI / UI (playwright) (push) Successful in 1m43s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Notify (push) Skipped

The registry's audit endpoint returned a spurious 400 ('Invalid package
tree') on an unchanged lockfile; the same commit passed minutes later.
Real advisories still fail at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-22 20:27:48 -05:00
1 parent 41480bf30a
commit 9980663f83
1 file changed
+11 -1
+11 -1
View File
@@ -61,7 +61,17 @@ jobs:
steps: steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Audit production and dev dependencies - name: Audit production and dev dependencies
run: npm audit --audit-level=high run: |
# Retry only when the registry itself fails (it has returned spurious 400s);
# a real advisory fails at once.
for attempt in 1 2 3; do
if out=$(npm audit --audit-level=high 2>&1); then echo "$out"; exit 0; fi
echo "$out"
echo "$out" | grep -q "audit endpoint returned an error" || exit 1
echo "npm registry error (attempt $attempt); retrying in 20s"
sleep 20
done
exit 1
- name: Software bill of materials (production dependencies) - name: Software bill of materials (production dependencies)
run: npm sbom --sbom-format cyclonedx --omit dev --package-lock-only > sbom.cdx.json run: npm sbom --sbom-format cyclonedx --omit dev --package-lock-only > sbom.cdx.json
- name: Keep the SBOM for each main build - name: Keep the SBOM for each main build