Add default retries for transient network failures when downloading pnpm (and optionally a retries input) #84
Copy link
Copy link
Open
Description
Summary
pnpm/setup has only partial retry coverage for network failures, so a single transient blip during setup can fail a CI job. Could the action retry downloads more robustly, or expose a retries input?
Current behavior (as of a088197, v3)
- Version resolution (
src/install-pnpm/download.ts): uses@actions/http-clientwithallowRetries: true, maxRetries: 3. The http-client retries only GET responses with 502/503/504. Connection-level errors (ECONNRESET, ETIMEDOUT, DNS failures) and other statuses such as 429/500 are not retried. - Binary download: delegated to
get-pnpm(0.0.5), which callsfetch()once with no retry. This seems the most likely point of failure. - Runtime install:
pnpm runtime set <name> <version> -grelies on pnpm's own network settings. It's unclear whetherfetch-retriesapplies here, and the README doesn't say.
Workflow
- uses: pnpm/setup@a0881977cd8ea73b1ed212236c99ca10dcc80cf4 # v3
with:
node-version-file: ".node-version"
install: falseProposal
- Retry the pnpm binary download (in
get-pnpmor around the call) with exponential backoff, covering network errors as well as 429/5xx responses. - Extend version-resolution retries to cover connection errors and 429.
- Optionally, add a
retriesinput (or document thatpnpm_config_fetch_retriesapplies topnpm runtime set).
Workaround
Today, users have to duplicate the step with continue-on-error: true and a conditional second attempt, because GitHub Actions has no step-level retry for uses: steps.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
joshunger commentedon Oct 20, 2026