Skip to content

Commit e77689b

Browse files
committed
ci: reapply corepack windows fix to other jobs
1 parent 0b6bf13 commit e77689b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/run-tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ jobs:
110110
cache: "npm"
111111
cache-dependency-path: "**/package-lock.json"
112112
- uses: oven-sh/setup-bun@v2
113+
- name: Prefer npm global on windows
114+
if: runner.os == 'Windows'
115+
# On Windows by default PATH prefers corepack bundled with Node.js
116+
# This prepends npm global to PATH to ensure that npm installed global corepack is used instead
117+
run: |
118+
echo "$(npm config get prefix)" >> "$GITHUB_PATH"
119+
shell: bash
113120
- name: setup pnpm/yarn
114121
run: |
115122
npm install -g corepack
@@ -293,6 +300,13 @@ jobs:
293300
node-version: ${{ steps.decide-node-version.outputs.version }}
294301
cache: "npm"
295302
cache-dependency-path: "**/package-lock.json"
303+
- name: Prefer npm global on windows
304+
if: runner.os == 'Windows'
305+
# On Windows by default PATH prefers corepack bundled with Node.js
306+
# This prepends npm global to PATH to ensure that npm installed global corepack is used instead
307+
run: |
308+
echo "$(npm config get prefix)" >> "$GITHUB_PATH"
309+
shell: bash
296310
- name: setup pnpm/yarn
297311
run: corepack enable
298312
shell: bash

0 commit comments

Comments
 (0)