Skip to content

fix(ci): remove registry-url to stop GitHub token injection#14

Merged
bntvllnt merged 2 commits intomainfrom
fix/ci-publish-oidc
Apr 26, 2026
Merged

fix(ci): remove registry-url to stop GitHub token injection#14
bntvllnt merged 2 commits intomainfrom
fix/ci-publish-oidc

Conversation

@bntvllnt
Copy link
Copy Markdown
Contributor

Root cause

actions/setup-node@v4 defaults its token: input to github.token, so using registry-url caused it to inject the GitHub Actions token as NODE_AUTH_TOKEN. npm then tried to authenticate to npmjs.org with a GitHub token → E404 Not Found.

Fix

Remove registry-url: https://registry.npmjs.org from setup-node in both canary and release jobs. Without it, setup-node doesn't create an .npmrc or inject any token. npm publish --provenance then uses the OIDC trusted publisher flow directly with the GitHub Actions OIDC token.

Requires trusted publisher to be configured on npmjs.com (already done).

actions/setup-node@v4 defaults token: to github.token, which sets
NODE_AUTH_TOKEN to the GitHub Actions token — not an npm token. npm
then tried to authenticate with npmjs.org using a GitHub token, causing
E404. Removing registry-url prevents setup-node from creating the .npmrc
and injecting any token, letting OIDC trusted publisher auth work cleanly
via --provenance.
@bntvllnt bntvllnt self-assigned this Apr 26, 2026
Mirror the pattern from the ui repo:
- Keep registry-url so setup-node creates .npmrc
- sed + unset to strip the injected GitHub token
- pnpm pack to build the tarball
- npx --yes npm@latest to publish via latest npm on-the-fly
  (avoids the broken npm install -g npm@latest on the runner)
@bntvllnt bntvllnt merged commit 92ad52f into main Apr 26, 2026
2 checks passed
@bntvllnt bntvllnt deleted the fix/ci-publish-oidc branch April 26, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant