Skip to content

Commit 2a79b57

Browse files
DavertMikclaude
andcommitted
ci: drop registry-url from setup-node — it breaks trusted publishing
setup-node with registry-url writes an .npmrc containing //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} With no NODE_AUTH_TOKEN in env (which is the whole point of trusted publishing), npm substitutes an empty string and sends Authorization: Bearer — an empty token — which short-circuits the OIDC flow. The sigstore sign still works (separate OIDC exchange), but the final PUT to registry.npmjs.org gets rejected with a misleading 404 Not Found - PUT https://registry.npmjs.org/@codeceptjs%2freflection Omitting registry-url lets npm use its default registry and attempt OIDC automatically. No behavior change since registry.npmjs.org is the default anyway. Run 24362973570 shows the exact symptom: sigstore log entry 1288262459 signed successfully, followed by the 404. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4f71a7f commit 2a79b57

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,19 @@ jobs:
3131
with:
3232
ref: ${{ github.event.release.target_commitish }}
3333

34-
- name: Setup Node 22 with npm registry
34+
# IMPORTANT: do NOT pass `registry-url` to setup-node here.
35+
# When registry-url is set, setup-node writes a .npmrc with
36+
# //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
37+
# and with no NODE_AUTH_TOKEN in env, npm sends an empty Bearer
38+
# header which short-circuits the trusted-publishing OIDC flow
39+
# (sigstore still works, but the final PUT gets rejected as 404).
40+
# Omitting registry-url lets npm use its default registry and
41+
# attempt OIDC automatically for packages with a configured
42+
# trusted publisher.
43+
- name: Setup Node 22
3544
uses: actions/setup-node@v4
3645
with:
3746
node-version: 22
38-
registry-url: 'https://registry.npmjs.org'
3947

4048
- name: Install dependencies
4149
run: npm install

0 commit comments

Comments
 (0)