fix(ci): drop registry-url from setup-node so OIDC trusted publishing works#15
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
release.ymlrun that fired on the PR #14 (1.1.0) merge failed insidechangesets/action'spnpm releasestep (run 25931442199). This was the first publish attempt under pure OIDC trusted publishing — PR #11 removed the bootstrapNPM_TOKENafter 1.0.0 landed, and 1.0.0 itself published via that token, so this is the first OIDC publish path we've actually exercised.Root cause
actions/setup-node, when givenregistry-url:, writes an.npmrccontaining:npm 11 reads that, sees a configured
_authToken, and uses it instead of running the OIDC exchange. We deliberately don't setNODE_AUTH_TOKEN(we want OIDC), so the resulting credential is empty/garbage andnpm publish4xx's. That bubbles up asThe process '/home/runner/setup-pnpm/node_modules/.bin/pnpm' failed with exit code 1, which is exactly what the failed run shows.npm's trusted-publishing flow only triggers when no token is configured at all. The fix is to stop having
setup-nodewrite a token entry — i.e. dropregistry-url:. The default registry isregistry.npmjs.org, so the option was decorative anyway.References:
setup-nodehas a default token; clearing it makes OIDC work")What changes
.github/workflows/release.yml: removeregistry-url: https://registry.npmjs.orgfrom theactions/setup-nodestep. Add a comment block on top of the step so the next person reaching forregistry-url:knows why it's deliberately absent.Out of scope (deliberately)
The failed run also surfaced an
app-iddeprecation warning fromactions/create-github-app-token@v3(useclient-idinstead). That's a warning, not the failure, and the App's Client ID is a different value from its numeric App ID — flipping the input without rotating theRELEASE_APP_IDsecret to aRELEASE_APP_CLIENT_IDwould silently mint a broken token. Worth a follow-up issue / PR with coordinated secret rotation; not bundled here.No changeset: CI-only workflow change, no user-visible behavior.
Test plan
main,release.ymlfires. No changesets remain (1.1.0 was already versioned and merged), sochangesets/actionfalls straight through topnpm release. Expect: trusted-publisher OIDC exchange succeeds,github-actions-updater@1.1.0lands on npm with provenance, the floatingv1tag is force-moved to the new commit.Note on idempotency: if
1.1.0was already published to npm during an earlier attempt (it wasn't, per the failed run),npm publishwill return 403 on a re-run. That'd require either a1.1.1patch bump ornpm unpublishwithin the 72h window.Generated by Claude Code