Skip to content

Commit 994d756

Browse files
zkochanclaude
andauthored
feat: read pnpm version from devEngines.packageManager (#211)
* feat: read pnpm version from devEngines.packageManager field When no version is specified in the action config or the packageManager field of package.json, fall back to devEngines.packageManager. Co-Authored-By: Claude Opus 4.6 <[email protected]> * feat: skip self-update for devEngines.packageManager and add CI tests pnpm auto-switches to the right version when devEngines.packageManager is set, so self-update is unnecessary. This also enables range support (e.g. ">=9.15.0") which self-update doesn't handle. --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent 738f428 commit 994d756

File tree

5 files changed

+391
-178
lines changed

5 files changed

+391
-178
lines changed

.github/workflows/test.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,56 @@ jobs:
108108
pnpm add is-odd
109109
shell: bash
110110

111+
test_dev_engines:
112+
name: Test with devEngines.packageManager
113+
114+
runs-on: ${{ matrix.os }}
115+
116+
strategy:
117+
fail-fast: false
118+
matrix:
119+
os:
120+
- ubuntu-latest
121+
- macos-latest
122+
- windows-latest
123+
version:
124+
- '9.15.5'
125+
- '>=9.15.0'
126+
127+
steps:
128+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
129+
130+
- name: Set up package.json with devEngines.packageManager
131+
run: echo '{"devEngines":{"packageManager":{"name":"pnpm","version":"${{ matrix.version }}","onFail":"download"}}}' > package.json
132+
shell: bash
133+
134+
- name: Run the action
135+
uses: ./
136+
137+
- name: 'Test: which'
138+
run: which pnpm; which pnpx
139+
140+
- name: 'Test: version'
141+
run: |
142+
set -e
143+
required='${{ matrix.version }}'
144+
actual="$(pnpm --version)"
145+
echo "pnpm version: ${actual}"
146+
147+
if [ "${required}" = ">=9.15.0" ]; then
148+
min="9.15.0"
149+
if [ "$(printf '%s\n' "${min}" "${actual}" | sort -V | head -n1)" != "${min}" ]; then
150+
echo "Expected pnpm version >= ${min}, but got ${actual}"
151+
exit 1
152+
fi
153+
else
154+
if [ "${actual}" != "${required}" ]; then
155+
echo "Expected pnpm version ${required}, but got ${actual}"
156+
exit 1
157+
fi
158+
fi
159+
shell: bash
160+
111161
test_run_install:
112162
name: 'Test with run_install (${{ matrix.run_install.name }}, ${{ matrix.os }})'
113163

dist/index.js

Lines changed: 116 additions & 115 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/install-pnpm/bootstrap/exe-lock.json

Lines changed: 182 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,40 @@
55
"packages": {
66
"": {
77
"dependencies": {
8-
"@pnpm/exe": "10.32.1"
8+
"@pnpm/exe": "11.0.0-beta.3"
99
}
1010
},
1111
"node_modules/@pnpm/exe": {
12-
"version": "10.32.1",
13-
"resolved": "https://registry.npmjs.org/@pnpm/exe/-/exe-10.32.1.tgz",
14-
"integrity": "sha512-baEtwHeZwmZAdBuuDDL6tbdGg5KpxhPxr3QFfYTGXvY6ws+Z1bN0mQ7ZjcaXBSC1HuLpVXnZ6NsBiaZ2DMv4vg==",
12+
"version": "11.0.0-beta.3",
13+
"resolved": "https://registry.npmjs.org/@pnpm/exe/-/exe-11.0.0-beta.3.tgz",
14+
"integrity": "sha512-yWNlHHdYmvf4c0MCkCzAa4csJDPdA+7yJCbXBUDXMbUu/0Zv/AxtO77q24MwlnBUC0dWeA+0F/pPmdkR9aTV2A==",
1515
"hasInstallScript": true,
1616
"license": "MIT",
17+
"dependencies": {
18+
"@reflink/reflink": "0.1.19"
19+
},
1720
"bin": {
18-
"pnpm": "pnpm"
21+
"pn": "pn",
22+
"pnpm": "pnpm",
23+
"pnpx": "pnpx",
24+
"pnx": "pnx"
1925
},
2026
"funding": {
2127
"url": "https://opencollective.com/pnpm"
2228
},
2329
"optionalDependencies": {
24-
"@pnpm/linux-arm64": "10.32.1",
25-
"@pnpm/linux-x64": "10.32.1",
26-
"@pnpm/macos-arm64": "10.32.1",
27-
"@pnpm/macos-x64": "10.32.1",
28-
"@pnpm/win-arm64": "10.32.1",
29-
"@pnpm/win-x64": "10.32.1"
30+
"@pnpm/linux-arm64": "11.0.0-beta.3",
31+
"@pnpm/linux-x64": "11.0.0-beta.3",
32+
"@pnpm/macos-arm64": "11.0.0-beta.3",
33+
"@pnpm/macos-x64": "11.0.0-beta.3",
34+
"@pnpm/win-arm64": "11.0.0-beta.3",
35+
"@pnpm/win-x64": "11.0.0-beta.3"
3036
}
3137
},
3238
"node_modules/@pnpm/linux-arm64": {
33-
"version": "10.32.1",
34-
"resolved": "https://registry.npmjs.org/@pnpm/linux-arm64/-/linux-arm64-10.32.1.tgz",
35-
"integrity": "sha512-6uB0B+XvunQwHGzIMk2JCkl4Ur6BtM4XbJSwB/mgpWmXDoX/KTJmgx2lodcTjgJSGSySCHfIVuTR9sj/F2D4EA==",
39+
"version": "11.0.0-beta.3",
40+
"resolved": "https://registry.npmjs.org/@pnpm/linux-arm64/-/linux-arm64-11.0.0-beta.3.tgz",
41+
"integrity": "sha512-TF2fyuCY9GggR4kfhjo1hMmgn+rIohenwNoH0tLPM7JlBK7/UAIFt1LI+o999tRwTCEw7gnxHFwtI2vyQuDfNw==",
3642
"cpu": [
3743
"arm64"
3844
],
@@ -41,17 +47,14 @@
4147
"os": [
4248
"linux"
4349
],
44-
"bin": {
45-
"pnpm": "pnpm"
46-
},
4750
"funding": {
4851
"url": "https://opencollective.com/pnpm"
4952
}
5053
},
5154
"node_modules/@pnpm/linux-x64": {
52-
"version": "10.32.1",
53-
"resolved": "https://registry.npmjs.org/@pnpm/linux-x64/-/linux-x64-10.32.1.tgz",
54-
"integrity": "sha512-AM2tv23Fg7h+nV+adqA/SkZKUysSIEetHfBwYFl8ArgdgkqbGoQy0rAOdKYQBb920CqfexXfI8OA8kPCzRxYng==",
55+
"version": "11.0.0-beta.3",
56+
"resolved": "https://registry.npmjs.org/@pnpm/linux-x64/-/linux-x64-11.0.0-beta.3.tgz",
57+
"integrity": "sha512-7GrLsnSuDH62y486GUTwJdohGIC1ugz9ZJkbKOHgxIAkNGcSTJ1IkkdARtv7/WMmOEwwESDmtpOQ6LmjnpDMSA==",
5558
"cpu": [
5659
"x64"
5760
],
@@ -60,17 +63,14 @@
6063
"os": [
6164
"linux"
6265
],
63-
"bin": {
64-
"pnpm": "pnpm"
65-
},
6666
"funding": {
6767
"url": "https://opencollective.com/pnpm"
6868
}
6969
},
7070
"node_modules/@pnpm/macos-arm64": {
71-
"version": "10.32.1",
72-
"resolved": "https://registry.npmjs.org/@pnpm/macos-arm64/-/macos-arm64-10.32.1.tgz",
73-
"integrity": "sha512-Zr4JkhRbtGVsYgbuGZO0dq/6FPOn072Pdo0ubmqWtc14cUATKgAJD7efG03yqr3MLgtwFHgdtUzZ1WsaYAtUTA==",
71+
"version": "11.0.0-beta.3",
72+
"resolved": "https://registry.npmjs.org/@pnpm/macos-arm64/-/macos-arm64-11.0.0-beta.3.tgz",
73+
"integrity": "sha512-NQKgI1DURrEiOUzpxL0Mc+yn7DV4tpShqGnjaJLbz8ZCXsX/qhmybebvCG3r+IfSk3P5KID66lcgC/Osiaz0Dg==",
7474
"cpu": [
7575
"arm64"
7676
],
@@ -79,17 +79,14 @@
7979
"os": [
8080
"darwin"
8181
],
82-
"bin": {
83-
"pnpm": "pnpm"
84-
},
8582
"funding": {
8683
"url": "https://opencollective.com/pnpm"
8784
}
8885
},
8986
"node_modules/@pnpm/macos-x64": {
90-
"version": "10.32.1",
91-
"resolved": "https://registry.npmjs.org/@pnpm/macos-x64/-/macos-x64-10.32.1.tgz",
92-
"integrity": "sha512-Yk6q3oFDu//OniXJxfTSHo+aew1LX81FcbzJAtEkcCeTQ0SLbQT6J3QiOMNikp8n8IjNhsy+bn2bdkUxaw+akA==",
87+
"version": "11.0.0-beta.3",
88+
"resolved": "https://registry.npmjs.org/@pnpm/macos-x64/-/macos-x64-11.0.0-beta.3.tgz",
89+
"integrity": "sha512-Ky22KFYHXx8+8WU4KJT9NXVgzFioL2w9pHTQjsqTK70AbxiErscPYhrFIehlCNbXjgs+tGVIy13QNKkiwvmS8w==",
9390
"cpu": [
9491
"x64"
9592
],
@@ -98,17 +95,14 @@
9895
"os": [
9996
"darwin"
10097
],
101-
"bin": {
102-
"pnpm": "pnpm"
103-
},
10498
"funding": {
10599
"url": "https://opencollective.com/pnpm"
106100
}
107101
},
108102
"node_modules/@pnpm/win-arm64": {
109-
"version": "10.32.1",
110-
"resolved": "https://registry.npmjs.org/@pnpm/win-arm64/-/win-arm64-10.32.1.tgz",
111-
"integrity": "sha512-P8rsP5IUetpYjr2iwggoswL2qUukYrJoToXWuMyo8immn58CsYxaXsHVQ1Oq1R3XMfmGGWTXLsiJuQ7H991MRg==",
103+
"version": "11.0.0-beta.3",
104+
"resolved": "https://registry.npmjs.org/@pnpm/win-arm64/-/win-arm64-11.0.0-beta.3.tgz",
105+
"integrity": "sha512-7L8TFNDm25m+XYSyhcola3YFd/li6BZzzl56SsyGnZabsvUslMwnDiJad48wOz8IuN7zsrTSGh+X/x6F+GdrFQ==",
112106
"cpu": [
113107
"arm64"
114108
],
@@ -117,17 +111,14 @@
117111
"os": [
118112
"win32"
119113
],
120-
"bin": {
121-
"pnpm": "pnpm.exe"
122-
},
123114
"funding": {
124115
"url": "https://opencollective.com/pnpm"
125116
}
126117
},
127118
"node_modules/@pnpm/win-x64": {
128-
"version": "10.32.1",
129-
"resolved": "https://registry.npmjs.org/@pnpm/win-x64/-/win-x64-10.32.1.tgz",
130-
"integrity": "sha512-i24GwbtBO8ojrhp8WWimX7NgZs0UKH1171oRt6qcRL+a+FxE0Eggv2y0KP7ZI7F3+LZMarwr3tnYsZryfciUOg==",
119+
"version": "11.0.0-beta.3",
120+
"resolved": "https://registry.npmjs.org/@pnpm/win-x64/-/win-x64-11.0.0-beta.3.tgz",
121+
"integrity": "sha512-Z/6OpMUaIpggXjCtWEhp6kWjiT/2EImhkJAu8AodOORqeNcWouGEq3sO4XU0em6d+pAHmdV0hWMQ2xCUmPVuiA==",
131122
"cpu": [
132123
"x64"
133124
],
@@ -136,12 +127,156 @@
136127
"os": [
137128
"win32"
138129
],
139-
"bin": {
140-
"pnpm": "pnpm.exe"
141-
},
142130
"funding": {
143131
"url": "https://opencollective.com/pnpm"
144132
}
133+
},
134+
"node_modules/@reflink/reflink": {
135+
"version": "0.1.19",
136+
"resolved": "https://registry.npmjs.org/@reflink/reflink/-/reflink-0.1.19.tgz",
137+
"integrity": "sha512-DmCG8GzysnCZ15bres3N5AHCmwBwYgp0As6xjhQ47rAUTUXxJiK+lLUxaGsX3hd/30qUpVElh05PbGuxRPgJwA==",
138+
"license": "MIT",
139+
"engines": {
140+
"node": ">= 10"
141+
},
142+
"optionalDependencies": {
143+
"@reflink/reflink-darwin-arm64": "0.1.19",
144+
"@reflink/reflink-darwin-x64": "0.1.19",
145+
"@reflink/reflink-linux-arm64-gnu": "0.1.19",
146+
"@reflink/reflink-linux-arm64-musl": "0.1.19",
147+
"@reflink/reflink-linux-x64-gnu": "0.1.19",
148+
"@reflink/reflink-linux-x64-musl": "0.1.19",
149+
"@reflink/reflink-win32-arm64-msvc": "0.1.19",
150+
"@reflink/reflink-win32-x64-msvc": "0.1.19"
151+
}
152+
},
153+
"node_modules/@reflink/reflink-darwin-arm64": {
154+
"version": "0.1.19",
155+
"resolved": "https://registry.npmjs.org/@reflink/reflink-darwin-arm64/-/reflink-darwin-arm64-0.1.19.tgz",
156+
"integrity": "sha512-ruy44Lpepdk1FqDz38vExBY/PVUsjxZA+chd9wozjUH9JjuDT/HEaQYA6wYN9mf041l0yLVar6BCZuWABJvHSA==",
157+
"cpu": [
158+
"arm64"
159+
],
160+
"license": "MIT",
161+
"optional": true,
162+
"os": [
163+
"darwin"
164+
],
165+
"engines": {
166+
"node": ">= 10"
167+
}
168+
},
169+
"node_modules/@reflink/reflink-darwin-x64": {
170+
"version": "0.1.19",
171+
"resolved": "https://registry.npmjs.org/@reflink/reflink-darwin-x64/-/reflink-darwin-x64-0.1.19.tgz",
172+
"integrity": "sha512-By85MSWrMZa+c26TcnAy8SDk0sTUkYlNnwknSchkhHpGXOtjNDUOxJE9oByBnGbeuIE1PiQsxDG3Ud+IVV9yuA==",
173+
"cpu": [
174+
"x64"
175+
],
176+
"license": "MIT",
177+
"optional": true,
178+
"os": [
179+
"darwin"
180+
],
181+
"engines": {
182+
"node": ">= 10"
183+
}
184+
},
185+
"node_modules/@reflink/reflink-linux-arm64-gnu": {
186+
"version": "0.1.19",
187+
"resolved": "https://registry.npmjs.org/@reflink/reflink-linux-arm64-gnu/-/reflink-linux-arm64-gnu-0.1.19.tgz",
188+
"integrity": "sha512-7P+er8+rP9iNeN+bfmccM4hTAaLP6PQJPKWSA4iSk2bNvo6KU6RyPgYeHxXmzNKzPVRcypZQTpFgstHam6maVg==",
189+
"cpu": [
190+
"arm64"
191+
],
192+
"license": "MIT",
193+
"optional": true,
194+
"os": [
195+
"linux"
196+
],
197+
"engines": {
198+
"node": ">= 10"
199+
}
200+
},
201+
"node_modules/@reflink/reflink-linux-arm64-musl": {
202+
"version": "0.1.19",
203+
"resolved": "https://registry.npmjs.org/@reflink/reflink-linux-arm64-musl/-/reflink-linux-arm64-musl-0.1.19.tgz",
204+
"integrity": "sha512-37iO/Dp6m5DDaC2sf3zPtx/hl9FV3Xze4xoYidrxxS9bgP3S8ALroxRK6xBG/1TtfXKTvolvp+IjrUU6ujIGmA==",
205+
"cpu": [
206+
"arm64"
207+
],
208+
"license": "MIT",
209+
"optional": true,
210+
"os": [
211+
"linux"
212+
],
213+
"engines": {
214+
"node": ">= 10"
215+
}
216+
},
217+
"node_modules/@reflink/reflink-linux-x64-gnu": {
218+
"version": "0.1.19",
219+
"resolved": "https://registry.npmjs.org/@reflink/reflink-linux-x64-gnu/-/reflink-linux-x64-gnu-0.1.19.tgz",
220+
"integrity": "sha512-jbI8jvuYCaA3MVUdu8vLoLAFqC+iNMpiSuLbxlAgg7x3K5bsS8nOpTRnkLF7vISJ+rVR8W+7ThXlXlUQ93ulkw==",
221+
"cpu": [
222+
"x64"
223+
],
224+
"license": "MIT",
225+
"optional": true,
226+
"os": [
227+
"linux"
228+
],
229+
"engines": {
230+
"node": ">= 10"
231+
}
232+
},
233+
"node_modules/@reflink/reflink-linux-x64-musl": {
234+
"version": "0.1.19",
235+
"resolved": "https://registry.npmjs.org/@reflink/reflink-linux-x64-musl/-/reflink-linux-x64-musl-0.1.19.tgz",
236+
"integrity": "sha512-e9FBWDe+lv7QKAwtKOt6A2W/fyy/aEEfr0g6j/hWzvQcrzHCsz07BNQYlNOjTfeytrtLU7k449H1PI95jA4OjQ==",
237+
"cpu": [
238+
"x64"
239+
],
240+
"license": "MIT",
241+
"optional": true,
242+
"os": [
243+
"linux"
244+
],
245+
"engines": {
246+
"node": ">= 10"
247+
}
248+
},
249+
"node_modules/@reflink/reflink-win32-arm64-msvc": {
250+
"version": "0.1.19",
251+
"resolved": "https://registry.npmjs.org/@reflink/reflink-win32-arm64-msvc/-/reflink-win32-arm64-msvc-0.1.19.tgz",
252+
"integrity": "sha512-09PxnVIQcd+UOn4WAW73WU6PXL7DwGS6wPlkMhMg2zlHHG65F3vHepOw06HFCq+N42qkaNAc8AKIabWvtk6cIQ==",
253+
"cpu": [
254+
"arm64"
255+
],
256+
"license": "MIT",
257+
"optional": true,
258+
"os": [
259+
"win32"
260+
],
261+
"engines": {
262+
"node": ">= 10"
263+
}
264+
},
265+
"node_modules/@reflink/reflink-win32-x64-msvc": {
266+
"version": "0.1.19",
267+
"resolved": "https://registry.npmjs.org/@reflink/reflink-win32-x64-msvc/-/reflink-win32-x64-msvc-0.1.19.tgz",
268+
"integrity": "sha512-E//yT4ni2SyhwP8JRjVGWr3cbnhWDiPLgnQ66qqaanjjnMiu3O/2tjCPQXlcGc/DEYofpDc9fvhv6tALQsMV9w==",
269+
"cpu": [
270+
"x64"
271+
],
272+
"license": "MIT",
273+
"optional": true,
274+
"os": [
275+
"win32"
276+
],
277+
"engines": {
278+
"node": ">= 10"
279+
}
145280
}
146281
}
147282
}

0 commit comments

Comments
 (0)