Skip to content

Commit e7e0008

Browse files
committed
ci(publish): activate npm via Corepack for OIDC provenance
Global npm install -g failed on Node 22.22.x (MODULE_NOT_FOUND: promise-retry in @npmcli/arborist). Use corepack prepare instead of upgrading through the broken bundled npm. Drop check-latest on setup-node to match integration tests and avoid bleeding-edge toolchains. Made-with: Cursor
1 parent 8fd38f4 commit e7e0008

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ jobs:
5151
uses: actions/setup-node@v6
5252
with:
5353
node-version: 22
54-
check-latest: true
5554
cache: npm
5655

56+
# Corepack avoids `npm install -g npm` when the bundled global npm is broken (e.g. missing promise-retry).
5757
- name: Upgrade npm for trusted publishing (OIDC)
5858
if: steps.gate.outputs.publish == 'true'
59-
run: npm install -g npm@">=11.5.1"
59+
env:
60+
COREPACK_ENABLE_DOWNLOAD_PROMPT: 0
61+
run: |
62+
corepack enable
63+
corepack prepare npm@11.5.1 --activate
64+
npm --version
6065
6166
- name: Ensure versions match
6267
if: steps.gate.outputs.publish == 'true'

0 commit comments

Comments
 (0)