Skip to content

Commit 0319de4

Browse files
claudeylabonte
authored andcommitted
fix(ci): drop registry-url from setup-node so OIDC trusted publishing works
The 1.1.0 release attempt — the first pure-OIDC publish after PR #11 dropped the bootstrap NPM_TOKEN — failed in https://github.com/ylabonte/github-actions-updater/actions/runs/25931442199 inside changesets/action's `pnpm release` step. `actions/setup-node` with `registry-url:` writes an `.npmrc` line `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}`. npm 11 sees a configured token entry and skips the OIDC exchange; we don't set NODE_AUTH_TOKEN (we want OIDC), so the resulting auth is empty and `npm publish` 4xx's, which is what bubbled up as the pnpm exit 1. Trusted publishing only kicks in with no token configured at all. Default registry is the public one, so dropping `registry-url:` is functionally a no-op for the registry pointer. Refs: - https://github.com/orgs/community/discussions/176761 - https://docs.npmjs.com/trusted-publishers/ Other release.yml polish items (rename `app-id` → `client-id` to silence the v3 deprecation warning, pin pnpm/action-setup, pin `npm install -g`) are intentionally out of scope — they are warnings, not the failure, and client-id ≠ app-id so the rename needs a coordinated secret rotation.
1 parent 2d8193e commit 0319de4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ jobs:
3535
fetch-depth: 0
3636
token: ${{ steps.app-token.outputs.token }}
3737
- uses: pnpm/action-setup@v6
38+
# Do NOT pass `registry-url:` to setup-node. It writes an `.npmrc` with
39+
# `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}`; npm 11 then sees
40+
# a token entry (empty, because we don't set NODE_AUTH_TOKEN — we want
41+
# OIDC) and skips the trusted-publisher exchange, so `npm publish` 4xx's
42+
# and `changeset publish` exits 1. Trusted publishing only kicks in when
43+
# *no* token is configured. Default registry is registry.npmjs.org, so
44+
# dropping `registry-url:` costs nothing.
3845
- uses: actions/setup-node@v6
3946
with:
4047
node-version: 20
4148
cache: pnpm
42-
registry-url: https://registry.npmjs.org
4349
# npm 11.5+ is required for trusted-publishing OIDC. Node 20 ships with npm 10.
4450
- run: npm install -g npm@latest
4551
- run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)