Skip to content

Commit 2b49a9b

Browse files
tianzhouclaude
andcommitted
fix: bootstrap npm 11.5+ for OIDC trusted publishing
Bundled npm in Node 22.22.2 is both broken (missing promise-retry) and too old (npm 10.x) for OIDC publishing which requires npm 11.5+. Bootstrap by downloading the tarball directly, matching the approach used in dbhub's workflow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 29d6c74 commit 2b49a9b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,16 @@ jobs:
120120
with:
121121
node-version: "22"
122122
cache: "pnpm"
123-
registry-url: "https://registry.npmjs.org"
123+
124+
# Upgrade npm for OIDC trusted publishing (requires npm 11.5+)
125+
# Bootstrap without npm since Node 22.22.2 ships with broken npm
126+
- name: Upgrade npm
127+
run: |
128+
npm_tarball=$(curl -fsSL https://registry.npmjs.org/npm/latest | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).dist.tarball")
129+
curl -fsSL "$npm_tarball" | tar xz -C /tmp
130+
node /tmp/package/bin/npm-cli.js install -g npm@latest
131+
rm -rf /tmp/package
132+
echo "npm version: $(npm --version)"
124133
125134
- name: Install dependencies
126135
run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)