Skip to content

Commit 3537421

Browse files
committed
fix(ci): use curl+tar for npm upgrade (no npm/npx self-install)
1 parent 692f2ec commit 3537421

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/provenance.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ jobs:
166166

167167
- uses: SocketDev/socket-registry/.github/actions/install@6096b06b1790f411714c89c40f72aade2eeaab7c # main
168168

169-
- run: npm install -g npm@11.12.1
169+
- name: Upgrade npm for trusted publishing
170+
run: |
171+
# Avoid npm self-upgrade (corrupts deps mid-install on Node 22).
172+
NPM_PREFIX="$(node -p 'process.config.variables.node_prefix')"
173+
curl -sL https://registry.npmjs.org/npm/-/npm-11.12.1.tgz | tar xz -C "$NPM_PREFIX/lib/node_modules/npm" --strip-components=1
174+
echo "npm version: $(npm --version)"
170175
171176
# Get versions for lock-stepped and independent packages.
172177
- name: Get versions

0 commit comments

Comments
 (0)