Skip to content

Pin pnpm to 11.5.2 - #158

Merged
mre merged 2 commits into
masterfrom
pin-pnpm-version
Jun 11, 2026
Merged

Pin pnpm to 11.5.2#158
mre merged 2 commits into
masterfrom
pin-pnpm-version

Conversation

@mre

@mre mre commented Jun 7, 2026

Copy link
Copy Markdown
Member

Add "packageManager": "pnpm@11.5.2" to package.json and replace pnpm@latest with pnpm@11.5.2 in the withastro/action workflows (deploy, check-links, check-pr-links). This pins pnpm to a single version so CI and local development agree and CI can't silently jump to a future major.

Background: CI installs with pnpm@latest while local environments may run older versions like pnpm 9, where the pnpm-workspace.yaml added in #153 (without a packages: field) causes every pnpm command to fail with ERROR packages field missing or empty, breaking make watch. The allowBuilds: config also requires pnpm 10.26+.

Supersedes #157.

@mre
mre force-pushed the pin-pnpm-version branch from 920e84f to b7eb45d Compare June 7, 2026 12:24
@mre mre changed the title Pin pnpm to 11.5.2 Pin pnpm to 10.34.1 Jun 7, 2026
CI floated on pnpm@latest, causing version drift with local environments and with the allowBuilds config in pnpm-workspace.yaml (which requires pnpm 10.26+). Pin pnpm via package.json's packageManager field and in the withastro/action workflows so CI and local development use the same version.
@mre
mre force-pushed the pin-pnpm-version branch from b7eb45d to 853891c Compare June 7, 2026 12:45
@mre mre changed the title Pin pnpm to 10.34.1 Pin pnpm to 11.5.2 Jun 7, 2026
@mre
mre requested review from katrinafyi and thomas-zahner June 7, 2026 12:48

@katrinafyi katrinafyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a huge headache, thanks for digging into it.

Is there any way to have GitHub actions use the package.json version rather than re-stating it?

@mre

mre commented Jun 7, 2026

Copy link
Copy Markdown
Member Author

Is there any way to have GitHub actions use the package.json version rather than re-stating it?

Hm! I didn't think of that. Will need to do some research, but good idea.

@mre

mre commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@katrinafyi, you were right. Addressed it in 0d086f6: instead of restating pnpm@11.5.2 in every withastro/action step, I removed the package-manager input entirely.

Looking at withastro/action's action.yml, when no package-manager input is given it:

  1. Auto-detects pnpm from pnpm-lock.yaml, and
  2. Since a packageManager field is present in package.json, leaves the version unset and passes package_json_file to pnpm/action-setup, which then reads the version from that field.

So package.json's packageManager field is now the single source of truth.

Instead of restating pnpm@11.5.2 in each withastro/action step, omit the
package-manager input. The action auto-detects pnpm from pnpm-lock.yaml and
pnpm/action-setup reads the version from the packageManager field in
package.json, making it the single source of truth (addresses review feedback).
@mre
mre force-pushed the pin-pnpm-version branch from 0d086f6 to 6a97650 Compare June 11, 2026 10:45
@mre
mre merged commit 71324e3 into master Jun 11, 2026
2 checks passed
@mre
mre deleted the pin-pnpm-version branch June 11, 2026 10:46
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.

3 participants