Skip to content

Commit 9fe9bb0

Browse files
committed
Remove yarn cache from setup-node to avoid corepack trigger
The setup-node action with cache: 'yarn' calls yarn --version to detect the version for caching, which triggers the bundled corepack BEFORE we can install yarn via npm. This causes the URL.canParse error. Solution: Remove cache property from all setup-node steps in both workflows. Yarn will be installed fresh in each job via npm install -g yarn@4.12.0. Changes: - Remove cache: 'yarn' from all setup-node steps - Remove lingering 'corepack enable' from install jobs - All jobs now: setup-node -> install yarn -> yarn install
1 parent 3b20fcb commit 9fe9bb0

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

.github/workflows/deploy-to-dev.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
- name: Checkout
3737
uses: actions/checkout@v4
3838

39-
- name: Enable Corepack
40-
run: corepack enable
41-
4239
- name: Setup node
4340
uses: actions/setup-node@v4
4441
with:
4542
node-version: ${{ matrix.node-version }}
46-
cache: "yarn"
43+
44+
- name: Install Yarn
45+
run: npm install -g yarn@4.12.0
46+
4747
- run: yarn install --immutable
4848

4949
lint:
@@ -61,7 +61,6 @@ jobs:
6161
uses: actions/setup-node@v4
6262
with:
6363
node-version: ${{ matrix.node-version }}
64-
cache: "yarn"
6564

6665
- name: Install Yarn
6766
run: npm install -g yarn@4.12.0
@@ -87,7 +86,6 @@ jobs:
8786
uses: actions/setup-node@v4
8887
with:
8988
node-version: ${{ matrix.node-version }}
90-
cache: "yarn"
9189

9290
- name: Install Yarn
9391
run: npm install -g yarn@4.12.0
@@ -110,7 +108,6 @@ jobs:
110108
uses: actions/setup-node@v4
111109
with:
112110
node-version: ${{ matrix.node-version }}
113-
cache: "yarn"
114111

115112
- name: Install Yarn
116113
run: npm install -g yarn@4.12.0

.github/workflows/pr.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v4
1919

20-
- name: Enable Corepack
21-
run: corepack enable
22-
2320
- name: Setup node
2421
uses: actions/setup-node@v4
2522
with:
2623
node-version: ${{ matrix.node-version }}
27-
cache: "yarn"
24+
25+
- name: Install Yarn
26+
run: npm install -g yarn@4.12.0
27+
2828
- run: yarn install --immutable
2929

3030
lint:
@@ -42,7 +42,6 @@ jobs:
4242
uses: actions/setup-node@v4
4343
with:
4444
node-version: ${{ matrix.node-version }}
45-
cache: "yarn"
4645

4746
- name: Install Yarn
4847
run: npm install -g yarn@4.12.0
@@ -65,7 +64,6 @@ jobs:
6564
uses: actions/setup-node@v4
6665
with:
6766
node-version: ${{ matrix.node-version }}
68-
cache: "yarn"
6967

7068
- name: Install Yarn
7169
run: npm install -g yarn@4.12.0
@@ -88,7 +86,6 @@ jobs:
8886
uses: actions/setup-node@v4
8987
with:
9088
node-version: ${{ matrix.node-version }}
91-
cache: "yarn"
9289

9390
- name: Install Yarn
9491
run: npm install -g yarn@4.12.0

0 commit comments

Comments
 (0)