Skip to content

Commit 348b4f5

Browse files
committed
ci: opt out of setup-node v6 default dependency caching
setup-node v6 enables dependency caching by default when it detects a package manager, and this workflow runs on push to main — so the cache is written to the default-branch scope every job can read. A poisoned cache is worst in the jobs that mint the ios-spm App token, hold contents:write, or publish with id-token:write, and the build job feeds npm install output into the shipped artifact. Set package-manager-cache: false on every setup-node step in the release workflow (also restores the pre-v6 no-cache behavior).
1 parent 4d45a9e commit 348b4f5

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/npm_release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ jobs:
5454
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
5555
with:
5656
node-version: 22
57+
# setup-node v6 enables dependency caching by default when it
58+
# detects a package manager — a cache-poisoning vector, worst in the
59+
# jobs that mint App tokens or publish. Disabled on every setup-node
60+
# step in this workflow (also keeps pre-v6 behavior).
61+
package-manager-cache: false
5762
- name: Install deps for version scripts
5863
run: npm install --no-audit --no-fund
5964
- name: Compute version and tag
@@ -128,6 +133,7 @@ jobs:
128133
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
129134
with:
130135
node-version: 22
136+
package-manager-cache: false
131137
registry-url: "https://registry.npmjs.org"
132138
- name: Install Python
133139
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
@@ -190,6 +196,7 @@ jobs:
190196
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
191197
with:
192198
node-version: 22
199+
package-manager-cache: false
193200
- name: Install Python
194201
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
195202
with:
@@ -270,6 +277,7 @@ jobs:
270277
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
271278
with:
272279
node-version: 22
280+
package-manager-cache: false
273281
- name: Setup
274282
run: npm install --no-audit --no-fund
275283
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
@@ -345,6 +353,7 @@ jobs:
345353
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
346354
with:
347355
node-version: 22
356+
package-manager-cache: false
348357
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
349358
with:
350359
pattern: spm-artifacts-*
@@ -419,6 +428,7 @@ jobs:
419428
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
420429
with:
421430
node-version: 22
431+
package-manager-cache: false
422432
registry-url: "https://registry.npmjs.org"
423433
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
424434
with:
@@ -482,6 +492,7 @@ jobs:
482492
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
483493
with:
484494
node-version: 22
495+
package-manager-cache: false
485496
- name: Assert ios-spm manifest pins this release
486497
run: |
487498
# Guard against the tag pointing at a STALE manifest — e.g. a

0 commit comments

Comments
 (0)