Skip to content

ci: match pnpm version exactly to packageManager pin - #128

Merged
jackchuka merged 2 commits into
mainfrom
fix/pin-pnpm-exact
May 6, 2026
Merged

jackchuka merged 2 commits into
mainfrom
fix/pin-pnpm-exact

Conversation

@jackchuka

@jackchuka jackchuka commented May 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Reads .packageManager from package.json at workflow runtime and passes the version to pnpm/action-setup's version: input
  • Single source of truth: bumping packageManager (which Dependabot already does) automatically propagates to CI

Why this is needed

pnpm/action-setup#227: v6.0.3+ does not reliably install the packageManager version when version: is omitted — instead it falls back to the bootstrap pnpm (currently v11.0.0-rc.5), which fails npm Trusted Publishing OIDC auth (ENEEDAUTH). That's the original regression that broke v1.3.11 / v1.3.12 / v1.3.13.

But specifying a hardcoded version: (e.g. 10.33.0) creates a second place to keep in sync with packageManager, and Dependabot's github-actions ecosystem only updates uses: SHAs — it can't bump arbitrary workflow inputs.

The dynamic extraction satisfies action-setup v6.0.5's strict version-must-match-packageManager validation while keeping package.json as the only place to update.

Test plan

jackchuka added 2 commits May 7, 2026 01:12
pnpm/action-setup v6.0.5 errors out when the `version` input doesn't
exactly match the `packageManager` field in package.json:

    Error: Multiple versions of pnpm specified:
      - version 10 in the GitHub Action config with the key "version"
      - version pnpm@10.33.0 in the package.json with the key "packageManager"

Bumps the action-setup `version` input from `10` to `10.33.0` to match
the packageManager pin. Removing `version` entirely is not an option:
without it, action-setup v6.0.3+ installs pnpm v11.0.0-rc.5 as the
global shim, which fails npm Trusted Publishing (`ENEEDAUTH`).
Replaces the hardcoded `version: 10.33.0` input with a step that reads
`.packageManager` from package.json and feeds the result into
pnpm/action-setup. This makes package.json the single source of truth
and lets Dependabot's npm bumps cascade to the workflow without manual
edits.

Hardcoding worked but introduced a second place to keep in sync
(Dependabot can't update arbitrary workflow inputs). The dynamic
extraction satisfies pnpm/action-setup v6.0.5's strict
version-must-match-packageManager validation while leaving only one
file to update.

Revisit once pnpm/action-setup#227 ships a fix that lets us omit
`version` entirely.
@jackchuka
jackchuka merged commit 4104eb0 into main May 6, 2026
1 check passed
@jackchuka
jackchuka deleted the fix/pin-pnpm-exact branch May 6, 2026 16:26
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