[ci] Explicitly disable package-manager-cache for uses of actions/setup-node (#93953)

If this action detects that you're likely using `npm` it (by default)
enables a cache for `npm`. We use `pnpm`, so it doesn't do anything (and
we manually set up a pnpm cache in some places), but the implicit
behavior here is a little dangerous: e.g.
https://adnanthekhan.com/posts/angular-compromise-through-dev-infra/#finding-the-pivot

So let's explicitly disable this everywhere. It wasn't doing anything
for us anyways.
This commit is contained in:
Benjamin Woodruff
2026-05-27 06:05:07 +00:00
committed by GitHub
parent fda8a605dd
commit 67d5f9615a
20 changed files with 51 additions and 20 deletions
+6
View File
@@ -56,6 +56,7 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
@@ -124,6 +125,7 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
@@ -248,6 +250,7 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Prepare corepack
if: ${{ matrix.os != 'windows' }}
@@ -401,6 +404,7 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- run: corepack enable
- name: Install Rust
@@ -447,6 +451,7 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
@@ -512,6 +517,7 @@ jobs:
node-version: 24
check-latest: true
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
+4 -2
View File
@@ -150,10 +150,11 @@ jobs:
NEXT_SKIP_NATIVE_POSTINSTALL: 1
steps:
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup pnpm
run: |
@@ -227,9 +228,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
+2 -1
View File
@@ -27,10 +27,11 @@ jobs:
environment: release-${{ github.event.inputs.releaseType }}
steps:
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
+2 -1
View File
@@ -30,10 +30,11 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
check-latest: true
package-manager-cache: false
- name: Create GitHub App token
id: release-app-token
+3 -1
View File
@@ -10,7 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
+3 -1
View File
@@ -11,7 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
+2 -1
View File
@@ -155,9 +155,10 @@ jobs:
- name: Setup Node.js
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
package-manager-cache: false
- name: Install dependencies
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
@@ -65,6 +65,7 @@ jobs:
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- name: Enable corepack
run: corepack enable
@@ -39,10 +39,11 @@ jobs:
token: ${{ steps.release-app-token.outputs.token }}
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
@@ -100,10 +101,11 @@ jobs:
token: ${{ steps.release-app-token.outputs.token }}
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
@@ -73,6 +73,7 @@ jobs:
with:
node-version: 20
check-latest: true
package-manager-cache: false
- name: Setup corepack
if: steps.precheck.outputs.should_evaluate == 'true'
@@ -37,10 +37,11 @@ jobs:
uses: ./.github/actions/setup-rust
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- run: corepack enable
# We need to install the dependencies for the benchmark apps
@@ -52,10 +52,11 @@ jobs:
next-version: ${{ steps.version.outputs.value }}
steps:
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup pnpm
run: |
@@ -274,10 +275,11 @@ jobs:
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20.9.0
check-latest: true
package-manager-cache: false
- name: Download adapter test result artifacts
continue-on-error: true
@@ -27,10 +27,11 @@ jobs:
if: github.repository_owner == 'vercel'
steps:
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup pnpm
run: |
+2 -1
View File
@@ -35,10 +35,11 @@ jobs:
run: sudo ethtool -K eth0 tx off rx off
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g [email protected]
+2 -1
View File
@@ -47,10 +47,11 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
check-latest: true
package-manager-cache: false
- name: Create GitHub App token
id: release-app-token
@@ -39,10 +39,11 @@ jobs:
token: ${{ steps.release-app-token.outputs.token }}
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
@@ -96,10 +97,11 @@ jobs:
token: ${{ steps.release-app-token.outputs.token }}
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
+2 -1
View File
@@ -41,10 +41,11 @@ jobs:
token: ${{ steps.release-app-token.outputs.token }}
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
+2 -1
View File
@@ -47,10 +47,11 @@ jobs:
token: ${{ steps.release-app-token.outputs.token }}
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
+2 -1
View File
@@ -19,10 +19,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
@@ -28,6 +28,7 @@ jobs:
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
# Checkout from the default branch (canary) -- workflow_run always uses
# the default branch's version of the workflow file and this checkout