Skip to content

Harden CI build audit step against npm audit API timeouts - #8

Closed
isttiiak with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-build
Closed

isttiiak with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-build

Conversation

Copilot AI commented Sep 4, 2026 •

Copy link
Copy Markdown

The build GitHub Actions job was failing due to repeated pnpm audit socket timeouts against npm’s audit endpoint, not due to project code quality or build correctness. This change makes the audit step resilient to transient registry outages while preserving failure behavior for real audit errors.

  • Audit failure classification

    • Capture pnpm audit output and exit code per attempt.
    • Detect timeout-specific failures (ERR_SOCKET_TIMEOUT / Socket timeout) separately from all other failures.
  • Build job behavior update

    • Retry timeout failures up to 3 times with backoff.
    • If all attempts fail only due to timeout, exit successfully (non-blocking transient infra failure).
    • For any non-timeout audit failure (including vulnerability findings), fail the job immediately.
  • Scope

    • Workflow-only change in .github/workflows/ci.yml (build job pnpm audit step).
for i in 1 2 3; do
  output="$(pnpm audit 2>&1)"; status=$?
  if [ "$status" -eq 0 ]; then exit 0; fi

  if echo "$output" | grep -Eq 'ERR_SOCKET_TIMEOUT|Socket timeout'; then
    [ "$i" -lt 3 ] && sleep 30 && continue
    exit 0
  fi

  exit "$status"
done

@vercel

vercel Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fin-track Ready Ready Preview Sep 4, 2026 2:40am UTC

Co-authored-by: isttiiak <98909379+isttiiak@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'build' Harden CI build audit step against npm audit API timeouts Sep 4, 2026
Copilot AI requested a review from isttiiak September 4, 2026 02:41
@isttiiak

isttiiak commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Closing as superseded — not merging. The same fix (retry pnpm audit on registry timeouts, fail immediately on real findings, don't block the build if every attempt timed out) landed on main in 925738b on 2026-09-04 and has kept CI green since. Against current main this branch would only shorten the explanatory comment, reword two log lines and add an unreachable exit 0.

@isttiiak isttiiak closed this Oct 9, 2026

This branch was successfully deployed

1 active deployment
Preview — b799a4d0 Deployed Sep 4, 2026 by vercel[bot]
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.

2 participants