Skip to content

Commit 2568ec9

Browse files
chore: install corepack@latest before enabling to fix signature verification errors
1 parent 1a6421d commit 2568ec9

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/ci-build-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ jobs:
2323
node-version: ${{ matrix.node-version }}
2424
# setup-node must be called twice to correctly cache corepack-managed npm.
2525
# See: https://github.com/actions/setup-node/issues/531#issuecomment-3335630863
26+
# `corepack@latest` must be installed before `corepack enable npm` to avoid
27+
# signature verification errors against rotated npm registry keys.
28+
# See: https://github.com/nodejs/corepack/issues/612
2629
- name: Enable Corepack
2730
shell: bash
28-
run: corepack enable npm
31+
run: |
32+
npm install --global corepack@latest
33+
corepack enable npm
2934
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3035
with:
3136
cache: npm

.github/workflows/publish-npm.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ jobs:
1919
registry-url: 'https://registry.npmjs.org'
2020
# setup-node must be called twice to correctly cache corepack-managed npm.
2121
# See: https://github.com/actions/setup-node/issues/531#issuecomment-3335630863
22+
# `corepack@latest` must be installed before `corepack enable npm` to avoid
23+
# signature verification errors against rotated npm registry keys.
24+
# See: https://github.com/nodejs/corepack/issues/612
2225
- name: Enable Corepack
2326
shell: bash
24-
run: corepack enable npm
27+
run: |
28+
npm install --global corepack@latest
29+
corepack enable npm
2530
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2631
with:
2732
cache: npm

0 commit comments

Comments
 (0)