Skip to content

Commit 813fa89

Browse files
ralyodioclaude
andauthored
fix(actions): stop pinning pnpm version in node-pnpm packs (#720)
node-pnpm-ci and node-pnpm-test hardcoded `version:` for pnpm/action-setup@v4. When the target repo declares a `packageManager` field (e.g. pnpm@10.0.0), action-setup@v4 fails with ERR_PNPM_BAD_PM_VERSION on the mismatch — which broke b1dz.com CI. Rely on `packageManager` as the single source of truth (pnpm's recommended approach): drop the pinned `version` input from both workflow templates and remove the now-unused `pnpmVersion` input from schemas/manifests. Bump both packs 1.0.0 -> 1.1.0 and document the packageManager requirement. Tests updated. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f822815 commit 813fa89

11 files changed

Lines changed: 24 additions & 28 deletions

File tree

packages/actions/node-pnpm-ci/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Installs a GitHub Actions workflow for Node and TypeScript projects that use pnp
44

55
The workflow installs dependencies, runs typecheck, and runs tests with explicit read-only repository permissions.
66

7+
## Requirements
8+
9+
The repository's `package.json` must declare a `packageManager` field (e.g. `"packageManager": "pnpm@10.0.0"`). `pnpm/action-setup@v4` reads the pnpm version from there. The workflow does **not** pin a pnpm `version` itself — pinning one that disagrees with `packageManager` fails the run with `ERR_PNPM_BAD_PM_VERSION`.
10+
711
## Output
812

913
`node-pnpm-ci` writes `.github/workflows/ci.yml` through a pull request.

packages/actions/node-pnpm-ci/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id: node-pnpm-ci
22
name: Node pnpm CI
3-
version: 1.0.0
3+
version: 1.1.0
44
category: ci
55
description: Least-privilege Node/TypeScript CI workflow using pnpm install, typecheck, and test.
66
provider: github

packages/actions/node-pnpm-ci/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
"default": "22",
1010
"description": "Node.js version to install."
1111
},
12-
"pnpmVersion": {
13-
"type": "string",
14-
"default": "9",
15-
"description": "pnpm major version to install."
16-
},
1712
"installCommand": {
1813
"type": "string",
1914
"default": "pnpm install --frozen-lockfile",

packages/actions/node-pnpm-ci/sh1pt.actionpack.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ schemaVersion: 1
22
id: node-pnpm-ci
33
name: Node pnpm CI
44
description: Least-privilege Node/TypeScript CI workflow using pnpm — install, typecheck, test.
5-
version: 1.0.0
5+
version: 1.1.0
66
publisher: profullstack
77
visibility: public
88
license: MIT
@@ -29,10 +29,6 @@ inputs:
2929
type: string
3030
default: '22'
3131
description: Node.js version to install.
32-
pnpmVersion:
33-
type: string
34-
default: '9'
35-
description: pnpm major version to install.
3632
installCommand:
3733
type: string
3834
default: pnpm install --frozen-lockfile

packages/actions/node-pnpm-ci/workflow.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121

22+
# pnpm version is read from the "packageManager" field in package.json.
23+
# Do not pin a version here — it conflicts with packageManager and fails
24+
# with ERR_PNPM_BAD_PM_VERSION.
2225
- uses: pnpm/action-setup@v4
23-
with:
24-
version: {{pnpmVersion}}
2526

2627
- uses: actions/setup-node@v4
2728
with:

packages/actions/node-pnpm-test/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Installs the lightweight test workflow used by the sh1pt repository.
44

55
The workflow runs on pull requests and pushes to the configured branch, installs with pnpm, and runs the configured test command with `CI=true`.
66

7+
## Requirements
8+
9+
The repository's `package.json` must declare a `packageManager` field (e.g. `"packageManager": "pnpm@10.0.0"`). `pnpm/action-setup@v4` reads the pnpm version from there. The workflow does **not** pin a pnpm `version` itself — pinning one that disagrees with `packageManager` fails the run with `ERR_PNPM_BAD_PM_VERSION`.
10+
711
## Output
812

913
`node-pnpm-test` writes `.github/workflows/test.yml` through a pull request.

packages/actions/node-pnpm-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id: node-pnpm-test
22
name: Node pnpm Test
3-
version: 1.0.0
3+
version: 1.1.0
44
category: test
55
description: Node/pnpm test workflow based on sh1pt's own repository test workflow.
66
provider: github

packages/actions/node-pnpm-test/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
"default": "22",
1010
"description": "Node.js version to install."
1111
},
12-
"pnpmVersion": {
13-
"type": "string",
14-
"default": "9.12.0",
15-
"description": "pnpm version to install."
16-
},
1712
"pushBranch": {
1813
"type": "string",
1914
"default": "master",

packages/actions/node-pnpm-test/sh1pt.actionpack.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ schemaVersion: 1
22
id: node-pnpm-test
33
name: Node pnpm Test
44
description: Node/pnpm test workflow based on sh1pt's own repository test workflow.
5-
version: 1.0.0
5+
version: 1.1.0
66
publisher: profullstack
77
visibility: public
88
license: MIT
@@ -26,10 +26,6 @@ inputs:
2626
type: string
2727
default: '22'
2828
description: Node.js version to install.
29-
pnpmVersion:
30-
type: string
31-
default: 9.12.0
32-
description: pnpm version to install.
3329
pushBranch:
3430
type: string
3531
default: master

packages/actions/node-pnpm-test/workflow.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18+
# pnpm version is read from the "packageManager" field in package.json.
19+
# Do not pin a version here — it conflicts with packageManager and fails
20+
# with ERR_PNPM_BAD_PM_VERSION.
1821
- uses: pnpm/action-setup@v4
19-
with:
20-
version: {{pnpmVersion}}
2122

2223
- uses: actions/setup-node@v4
2324
with:

0 commit comments

Comments
 (0)