Skip to content

feat: support pnpm v11 by downloading from GitHub releases - #12

Merged
zkochan merged 6 commits into
mainfrom
install-pre-12
Jul 24, 2026
Merged

feat: support pnpm v11 by downloading from GitHub releases#12
zkochan merged 6 commits into
mainfrom
install-pre-12

Conversation

@zkochan

@zkochan zkochan commented Jul 24, 2026

Copy link
Copy Markdown
Member

What

Lowers the supported floor to pnpm v11 and switches the download source from the npm registry to pnpm's GitHub releases.

Why the source changed

The original README claimed v11 couldn't be used because it "isn't a standalone executable." Investigating (and CI) showed the real situation is subtler:

  • pnpm's npm per-platform packages differ by major, and for v11 (@pnpm/<os>-<arch>) they are only Node-SEA launchers that require the JS dist/ shipped separately in the main @pnpm/exe package. Downloading a single npm package yields a broken install (Cannot find module dist/pnpm.mjs) — caught by CI.
  • pnpm's GitHub release archives (pnpm-<os>-<arch>.tar.gz, pnpm-win32-<arch>.zip) bundle the launcher and its dist/ together as one self-contained download, for both v11 and v12, under one consistent naming scheme.

So downloading from GitHub releases unifies v11 and v12 under a single code path and Just Works.

Changes

  • src/install-pnpm/download.ts: resolve version against npm (exact/range/dist-tag), then download the matching self-contained archive from GitHub releases and extract it whole. Integrity is verified against the SHA-256 digest GitHub publishes per asset (replacing the previous npm sha512 check). MIN_SUPPORTED_MAJOR 12 → 11. Clear error when a resolved version has no GitHub release (some prereleases are npm-only).
  • New token input (default ${{ github.token }}) authenticates the release API lookup to avoid the anonymous rate limit.
  • README.md / action.yml: describe the GitHub-releases flow; document the token input; note v11 has no Intel-macOS (darwin-x64) binary.
  • .github/workflows/test.yaml: add v11 coverage — a cross-OS smoke-v11 job (ubuntu x64/arm64, macOS arm64, Windows) and a runtime-node-pnpm11 job (runtime install + pnpm install on v11). Repin v12 test versions from alpha.19 (no GitHub release) to alpha.21.
  • Rebuilt dist/index.js.

Verification

CI is fully green (21 jobs): all v11 jobs pass on ubuntu x64/arm64, macOS arm64, and Windows, including pnpm runtime set + pnpm install on v11; all v12 jobs pass. Locally verified end-to-end for 11.17.0, 12.0.0-alpha.21, ^11, and next-12 (download + sha256 + extract + pnpm --version + pnpx dispatch); pre-v11 is rejected by the floor.

Caveats

  • pnpm v11 has no Intel-macOS (darwin-x64) binary — that combination errors clearly and points to v12+. arm64 macOS, Linux (glibc + musl), and Windows are covered on v11.
  • Versions published to npm but not released on GitHub (some prereleases, e.g. 12.0.0-alpha.19) can't be installed and produce an actionable error.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for installing pnpm v11 and newer across supported platforms via official self-contained release assets (no Node.js/npm required).
    • Added SHA-256 checksum verification for downloaded pnpm archives.
    • Added an optional token input to enable authenticated release and checksum lookups.
  • Documentation
    • Updated setup instructions, compatibility guidance, and inputs to reflect pnpm v11+ and the new archive download flow.
  • Tests
    • Expanded CI smoke coverage for pnpm v11 across Ubuntu, macOS, and Windows, including runtime/installation scenarios.
    • Updated existing CI jobs to use the newer pnpm v12+ prerelease in their test matrix.

pnpm v11 stable ships native per-platform executables too, they are just
published under a different naming scheme than v12+:

  v11:  @pnpm/<os>-<arch>       (macos/win names, linuxstatic-<arch> for musl)
  v12+: @pnpm/exe.<os>-<arch>   (with a -musl suffix on Linux)

The action previously only queried the v12 names, so it rejected v11 with an
inaccurate "pnpm 11 is a Node.js program" message. Lower the floor to v11 and
select the executable package by resolved major. The version is now resolved
first (against the authoritative `pnpm` packument) so the major is known
before the per-platform package is chosen. Tarball layout is identical across
both schemes, so download/extract is unchanged.

Caveat: pnpm v11 publishes no native binary for Intel macOS (darwin-x64);
that combination errors clearly and points users to v12+.

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

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@zkochan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 40239117-b5b8-4b0d-b294-5f0427fc02cf

📥 Commits

Reviewing files that changed from the base of the PR and between f4775fb and 7dfc1e8.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (1)
  • src/install-pnpm/download.ts
📝 Walkthrough

Walkthrough

The action now supports pnpm v11+ self-contained binaries from GitHub releases, authenticated release lookups, SHA-256 verification, platform-specific archive extraction, updated compatibility documentation, and expanded CI coverage.

Changes

Release-based pnpm installation

Layer / File(s) Summary
Release resolution and input contract
action.yml, src/inputs/index.ts, src/install-pnpm/download.ts
Adds an optional GitHub token, supports pnpm v11+, resolves platform-specific GitHub release assets, and obtains published versions for semver resolution.
Archive verification and installation
src/install-pnpm/download.ts, src/install-pnpm/run.ts
Downloads release archives, verifies SHA-256 digests, extracts binaries, creates aliases, and passes the token through the installer flow.
Compatibility documentation and CI coverage
README.md, .github/workflows/test.yaml
Documents GitHub release downloads and pnpm v11 compatibility, adds pnpm v11 jobs, and updates existing CI versions to 12.0.0-alpha.21.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubAction
  participant PnpmResolver
  participant GitHubReleases
  participant LocalRunner
  GitHubAction->>PnpmResolver: version and token
  PnpmResolver->>GitHubReleases: request release metadata
  GitHubReleases-->>PnpmResolver: archive URL and SHA-256 digest
  PnpmResolver->>LocalRunner: resolved archive
  LocalRunner->>LocalRunner: verify, extract, and link pnpm
Loading

Possibly related PRs

  • pnpm/setup#1: Continues the initial action implementation with input, CI, and installer changes.
  • pnpm/setup#11: Covers the preceding standalone installer approach for pnpm v12.

Poem

A bunny found a release in the sky,
With a SHA-256 stamp flying by.
V11 hopped in, archives came down,
Aliases danced all over the town.
“pnpm is ready!” the rabbit cried.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding pnpm v11 support and switching downloads to GitHub releases.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch install-pre-12

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

zkochan and others added 3 commits July 24, 2026 21:20
The integration workflow only exercised pnpm 12. Add two jobs for the new
v11 path:

- smoke-v11: downloads pnpm 11 across ubuntu (x64/arm64), macOS (arm64), and
  Windows, asserting the v11 `@pnpm/<os>-<arch>` package resolves and pnpm
  lands on PATH. No Intel-macOS entry — v11 ships no darwin-x64 binary.
- runtime-node-pnpm11: installs pnpm 11, a node runtime via `pnpm runtime`,
  and runs `pnpm install` — validating the load-bearing assumption that
  `pnpm runtime` works on v11.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the npm-registry download with pnpm's GitHub release archives, which
carry a single self-contained binary per platform (`pnpm-<os>-<arch>.tar.gz`,
`pnpm-win32-<arch>.zip`). This unifies v11 and v12 under one code path and
fixes v11 support: v11's npm `@pnpm/<os>-<arch>` packages are only Node-SEA
launchers that need the JS `dist/` shipped separately in the main `@pnpm/exe`
package, so downloading a single npm package produced a broken install (CI
caught `Cannot find module dist/pnpm.mjs`). The GitHub archive bundles the
launcher and its `dist/` together, so extracting it yields a working layout.

Integrity is preserved: GitHub exposes a per-asset SHA-256 `digest` via the
releases API, which the action now verifies (replacing the npm sha512 check).
A `token` input (default `${{ github.token }}`) authenticates the API lookup
to avoid the anonymous rate limit.

Verified end-to-end on linux-x64 for 11.17.0, 12.0.0-alpha.21, ^11, and
next-12 (download + sha256 + extract + `pnpm --version` + pnpx dispatch);
pre-v11 is rejected by the floor.

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

Some pnpm prereleases (e.g. 12.0.0-alpha.19) are published to npm but have no
GitHub release, so they can't be downloaded as binaries. The test workflow
pinned alpha.19 throughout; move it to alpha.21, which has a release. Also make
fetchRelease turn the API 404 into an actionable error instead of a generic
"empty response".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zkochan zkochan changed the title feat: support installing pnpm v11 feat: support pnpm v11 by downloading from GitHub releases Jul 24, 2026
@zkochan
zkochan marked this pull request as ready for review July 24, 2026 20:07
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Support pnpm v11 by downloading self-contained archives from GitHub releases

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Lower pnpm support floor to v11 by switching installs to GitHub release archives.
• Verify downloads via GitHub-provided SHA-256 digests and extract full archive layout.
• Add CI coverage for pnpm v11 and document new token input and platform caveats.
Diagram

graph TD
R["GitHub Action runner"] --> D["resolve/download (download.ts)"] --> X["extract + link aliases"] --> FS[("dest / PNPM_HOME")] --> RT["pnpm runtime set"]
D --> NPM{{"npm registry"}}
D --> GH{{"GitHub Releases API"}} --> AS{{"release archive + sha256 digest"}} --> D
subgraph Legend
direction LR
_ext{{"External"}} ~~~ _proc["Process/Step"] ~~~ _fs[("Filesystem")]
end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep using npm per-platform packages (major-aware naming)
  • ➕ Avoids GitHub API dependency and release-tag availability issues
  • ➕ Keeps download source within npm ecosystem
  • ➖ pnpm v11 npm artifacts can be incomplete (SEA launcher without bundled dist), requiring multi-package assembly
  • ➖ More branching logic across majors/OSes and higher chance of broken installs
2. Direct-download GitHub assets without API (construct URL only)
  • ➕ Avoids GitHub API rate limits and token handling
  • ➕ Simpler networking surface (one download endpoint)
  • ➖ No reliable SHA-256 source unless you add/maintain a parallel checksum retrieval mechanism
  • ➖ Harder to produce actionable errors when a release/tag/asset is missing

Recommendation: Prefer the PR’s GitHub-releases-based approach: it unifies v11 and v12+ under a single install path that preserves the on-disk layout required by v11’s SEA builds, while also improving error messaging when assets or releases don’t exist. The added token input is a pragmatic mitigation for GitHub API rate limits, and SHA-256 verification via the asset digest is an appropriate integrity check for this source.

Files changed (7) +409 / -239

Enhancement (3) +133 / -71
index.tsPlumb 'token' through action inputs +2/-0

Plumb 'token' through action inputs

• Extends the Inputs interface with an optional 'token' and reads it from 'getInput('token')'. This enables authenticated GitHub API calls during pnpm release resolution.

src/inputs/index.ts

download.tsSwitch pnpm download source to GitHub releases with SHA-256 verification +128/-68

Switch pnpm download source to GitHub releases with SHA-256 verification

• Lowers the minimum supported pnpm major to 11, resolves version specs against the 'pnpm' packument/dist-tags, and fetches the matching GitHub release asset for the runner platform. Downloads tar.gz/zip archives, verifies SHA-256 via the GitHub asset 'digest', and extracts the entire archive to preserve v11’s required layout; also adds clearer errors for missing releases/assets.

src/install-pnpm/download.ts

run.tsPass 'token' into pnpm resolution and log GitHub download URL +3/-3

Pass 'token' into pnpm resolution and log GitHub download URL

• Threads the optional 'token' input into 'resolvePnpm' and updates logging to reference the GitHub asset URL. Keeps existing install directory setup and version sanity check behavior.

src/install-pnpm/run.ts

Tests (1) +111 / -13
test.yamlAdd pnpm v11 smoke/runtime coverage and repin v12 alpha +111/-13

Add pnpm v11 smoke/runtime coverage and repin v12 alpha

• Adds a cross-OS smoke job for pnpm 11 and a runtime+install job validating 'pnpm runtime' and 'pnpm install' on v11. Updates pinned v12 prerelease versions from alpha.19 to alpha.21 to match versions with GitHub release assets.

.github/workflows/test.yaml

Documentation (1) +7 / -4
README.mdDocument GitHub-releases install flow, v11 support floor, and 'token' input +7/-4

Document GitHub-releases install flow, v11 support floor, and 'token' input

• Updates the documentation to describe downloading pnpm from GitHub releases and extracting full archives (including v11 'dist/' layout). Documents the new 'token' input and notes the v11 darwin-x64 binary caveat.

README.md

Other (2) +158 / -151
action.ymlAdd 'token' input and update version support wording to v11+ +9/-2

Add 'token' input and update version support wording to v11+

• Introduces a 'token' input defaulting to '${{ github.token }}' for authenticated GitHub API release lookups. Updates the action metadata to reflect v11+ support and direct native executable installs.

action.yml

index.jsRebuild compiled action bundle +149/-149

Rebuild compiled action bundle

• Updates the distribution bundle to include the new GitHub-releases download flow, SHA-256 verification, and 'token' input plumbing. Ensures the published action runtime matches the updated TypeScript sources.

dist/index.js

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/install-pnpm/download.ts`:
- Around line 59-62: Make the Intel macOS guidance conditional in the
no-release-asset error within the download flow: append the pnpm v11 darwin-x64
note only when the current platform is darwin-x64, while keeping the generic
pnpm/version/asset error for Windows, Linux, and other platforms.
- Around line 150-168: Update fetchRelease to reject every non-success HTTP
response, not only 404, before returning response.result. Preserve the existing
specialized 404 message, and for statuses such as 401, 403, and 5xx throw a
clear error including the status and available GitHub error details so
resolvePnpm never receives a non-GitHubRelease payload.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 464c9db8-69c4-4317-9595-672b1934210a

📥 Commits

Reviewing files that changed from the base of the PR and between 6bfbb82 and d4851e1.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (6)
  • .github/workflows/test.yaml
  • README.md
  • action.yml
  • src/inputs/index.ts
  • src/install-pnpm/download.ts
  • src/install-pnpm/run.ts
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-05-11T16:19:49.450Z
Learnt from: zkochan
Repo: pnpm/setup PR: 1
File: src/cache-restore/run.ts:35-35
Timestamp: 2026-05-11T16:19:49.450Z
Learning: When using `actions/exec` (`getExecOutput` / `exec`), it is valid for the `commandLine` option to include both the command and its arguments in a single string (e.g., `getExecOutput('pnpm store path --silent')`). The library tokenizes `commandLine` internally (via `argStringToArray()`), so this behaves like passing an equivalent command + args array (e.g., `getExecOutput('pnpm', ['store','path','--silent'])`). In code reviews, do not flag this as incorrect—this matches documented behavior and a production-tested pattern.

Applied to files:

  • src/install-pnpm/run.ts
  • src/install-pnpm/download.ts
  • src/inputs/index.ts
🪛 LanguageTool
README.md

[uncategorized] ~25-~25: The official name of this software platform is spelled with a capital “H”.
Context: ...hecksum via the GitHub API. Defaults to ${{ github.token }}, which lifts the low anonymou...

(GITHUB)

🪛 zizmor (1.26.1)
.github/workflows/test.yaml

[warning] 72-72: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[warning] 105-105: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🔇 Additional comments (11)
README.md (1)

5-25: LGTM!

Also applies to: 113-113

.github/workflows/test.yaml (1)

23-29: LGTM!

Also applies to: 59-156, 228-228, 269-269, 285-285, 310-310, 367-367, 412-412, 449-449, 459-459, 486-486

action.yml (1)

11-12: LGTM!

Also applies to: 62-68

src/inputs/index.ts (1)

21-21: LGTM!

Also applies to: 62-62

src/install-pnpm/download.ts (6)

5-46: LGTM!


47-58: LGTM!

Also applies to: 63-72


82-115: LGTM!


117-148: LGTM!


170-204: LGTM!


213-246: LGTM!

src/install-pnpm/run.ts (1)

17-21: LGTM!

Comment thread src/install-pnpm/download.ts
Comment thread src/install-pnpm/download.ts
…ase lookups

- The "no Intel-macOS binary" hint was appended to every platform's
  no-asset error; show it only on darwin-x64, else point to the release page.
- fetchRelease treated any non-404 with a JSON body as success, so a 403
  rate-limit / 401 / 5xx slipped through and later threw an opaque TypeError
  on `release.assets`. Reject every non-200 with a clear HTTP-status error.

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/install-pnpm/download.ts`:
- Around line 60-64: Update the isIntelMac condition in the pnpm download error
handling to also require that version is major version 11, so the Intel macOS
upgrade guidance applies only to pnpm v11. Preserve the release-page fallback
for other versions, including v12+.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f5a4fe34-80d1-4562-a86c-40d6f8e95f6e

📥 Commits

Reviewing files that changed from the base of the PR and between d4851e1 and f4775fb.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (1)
  • src/install-pnpm/download.ts
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-05-11T16:19:49.450Z
Learnt from: zkochan
Repo: pnpm/setup PR: 1
File: src/cache-restore/run.ts:35-35
Timestamp: 2026-05-11T16:19:49.450Z
Learning: When using `actions/exec` (`getExecOutput` / `exec`), it is valid for the `commandLine` option to include both the command and its arguments in a single string (e.g., `getExecOutput('pnpm store path --silent')`). The library tokenizes `commandLine` internally (via `argStringToArray()`), so this behaves like passing an equivalent command + args array (e.g., `getExecOutput('pnpm', ['store','path','--silent'])`). In code reviews, do not flag this as incorrect—this matches documented behavior and a production-tested pattern.

Applied to files:

  • src/install-pnpm/download.ts
🔇 Additional comments (1)
src/install-pnpm/download.ts (1)

167-171: LGTM!

Comment thread src/install-pnpm/download.ts Outdated
v12+ does ship a darwin-x64 binary, so only v11 should suggest upgrading; any
other missing-asset case now points to the release page regardless of platform.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zkochan
zkochan merged commit 6523ce9 into main Jul 24, 2026
26 checks passed
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.

1 participant