Fix Release CI: switch npm publish to trusted publishing (OIDC)#15
Merged
Conversation
The Release workflow failed on every push that reached changeset publish before a manual npm publish happened: the repo has no NPM_TOKEN secret, so npm publish exited 1. Switch to npm trusted publishing so CI needs no token at all: - add id-token: write permission for OIDC - bump to Node 24 (npm >= 11.5.1, required for trusted publishing) - pre-create ~/.npmrc so changesets/action doesn't write a token-based one, letting npm fall back to OIDC - drop the unused NPM_TOKEN env Requires a one-time Trusted Publisher setup on npmjs.com for @wendylabsinc/react-three-map (repo wendylabsinc/react-three-map, workflow release.yml).
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.
Problem
The Release workflow failed on the last two pushes to main (merges of #12 and #13) with
npm ... failed with exit code 1in the changesets publish step.Root cause: the repo has no
NPM_TOKENsecret (gh secret listis empty), but the workflow passessecrets.NPM_TOKENtochangeset publish, sonpm publishfails with an auth error. The npm publish timestamps show every past release (1.0.6–1.0.9) was published manually seconds-to-minutes after the push — the "green" Release runs were no-ops where the version was already on npm. CI publishing has never actually worked.The build itself is fine:
npm ci+npm run buildpass at HEAD (verified locally on Node 24 / npm 11.6.2).Fix
Switch to npm trusted publishing so CI needs no token and nothing ever needs rotating (npm revoked classic tokens in Dec 2025 and caps granular write-token lifetimes):
id-token: writepermission for OIDCenginesallows ≥ 20)~/.npmrcsochangesets/actiondoesn't write its token-based one, letting npm fall through to OIDCNPM_TOKENenv referenceOn npmjs.com, under @wendylabsinc/react-three-map settings, add a Trusted Publisher:
wendylabsincreact-three-maprelease.ymlWithout this, the publish step will still fail.