Skip to content

Commit 071edfc

Browse files
authored
ci: overwrite the runner's stale yarn shims instead of reinstalling corepack (#2352)
1 parent e38e706 commit 071edfc

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,16 @@ jobs:
8585
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8686
with:
8787
persist-credentials: false
88-
# Windows runners ship a corepack too old for current package manager signatures (#2062).
89-
- run: npm install -g corepack --force # zizmor: ignore[adhoc-packages] required to fix broken corepack on windows runners
88+
# The windows runner image's C:\npm\prefix yarn shims resolve to yarn
89+
# 1.x, so corepack must overwrite them in place. The old workaround
90+
# reinstalled corepack with npm (~10s per windows job); overwriting
91+
# the shims directly costs 3-4s. The image's corepack validates the
92+
# pinned yarn's signature fine (#2062 no longer reproduces), so
93+
# integrity checking stays on.
94+
- run: corepack enable --install-directory "C:\npm\prefix"
95+
if: runner.os == 'Windows'
9096
- run: corepack enable
97+
if: runner.os != 'Windows'
9198
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
9299
with:
93100
node-version: ${{ matrix.node-version }}

0 commit comments

Comments
 (0)