Repository navigation
ci: match pnpm version exactly to packageManager pin - #128
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.packageManagerfrompackage.jsonat workflow runtime and passes the version topnpm/action-setup'sversion:inputpackageManager(which Dependabot already does) automatically propagates to CIWhy this is needed
pnpm/action-setup#227: v6.0.3+ does not reliably install the
packageManagerversion whenversion: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 withpackageManager, and Dependabot'sgithub-actionsecosystem only updatesuses:SHAs — it can't bump arbitrary workflow inputs.The dynamic extraction satisfies action-setup v6.0.5's strict
version-must-match-packageManagervalidation while keepingpackage.jsonas the only place to update.Test plan
Publish to NPMsucceeds and the provenance statement is loggedversion:once action-setup@v6 does not install pnpm version specified inpackage_json_filepnpm/action-setup#227 is fixed