Skip to content

Fix Release CI: switch npm publish to trusted publishing (OIDC)#15

Merged
zamderax merged 1 commit into
mainfrom
claude/dreamy-albattani-5bd6e5
Jul 7, 2026
Merged

Fix Release CI: switch npm publish to trusted publishing (OIDC)#15
zamderax merged 1 commit into
mainfrom
claude/dreamy-albattani-5bd6e5

Conversation

@zamderax

@zamderax zamderax commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Problem

The Release workflow failed on the last two pushes to main (merges of #12 and #13) with npm ... failed with exit code 1 in the changesets publish step.

Root cause: the repo has no NPM_TOKEN secret (gh secret list is empty), but the workflow passes secrets.NPM_TOKEN to changeset publish, so npm publish fails 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 build pass 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):

  • add id-token: write permission for OIDC
  • bump the job to Node 24 (ships npm ≥ 11.5.1, required for trusted publishing; package engines allows ≥ 20)
  • pre-create a plain ~/.npmrc so changesets/action doesn't write its token-based one, letting npm fall through to OIDC
  • drop the dead NPM_TOKEN env reference

⚠️ Required one-time setup before merging

On npmjs.com, under @wendylabsinc/react-three-map settings, add a Trusted Publisher:

Field Value
Organization/user wendylabsinc
Repository react-three-map
Workflow filename release.yml
Environment (leave blank)

Without this, the publish step will still fail.

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).
@zamderax zamderax merged commit 3012861 into main Jul 7, 2026
2 checks passed
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