Skip to content

ci: publish to npm via OIDC trusted publishing instead of NPM_TOKEN - #16

Merged
webcoderspeed merged 1 commit into
masterfrom
ci/npm-trusted-publishing
Aug 5, 2026
Merged

ci: publish to npm via OIDC trusted publishing instead of NPM_TOKEN#16
webcoderspeed merged 1 commit into
masterfrom
ci/npm-trusted-publishing

Conversation

@webcoderspeed

Copy link
Copy Markdown
Owner

Fixes the failed release on master.

What broke

OIDC token exchange with the npm registry failed:
404 OIDC token exchange error - package not found
ENONPMTOKEN No npm token specified.

Two independent blockers

1. OIDC was not fully wired. semantic-release v25 does attempt trusted publishing, so the fix is to remove the token fallback and satisfy what OIDC needs:

  • Dropped NPM_TOKEN from both release paths — no long-lived credential
  • Added registry-url to setup-node
  • Added npm install -g npm@latest — trusted publishing requires npm >= 11.5.1 and Node 22 ships npm 10.x

2. No git tags existed. semantic-release derives the next version from git tags, not from the registry. With zero tags it would have recomputed 1.0.0 and collided with what is already published.

Pushed a v1.0.1 baseline tag at 768d583 — that is the exact commit the published exostate@1.0.1 records as its gitHead, so this is reconstructed from the registry rather than guessed. The next release now computes 1.1.0 from the feat: commits that follow it.

Required before merging

A trusted publisher must be configured for exostate on npmjs.com, bound to this repository and workflow file. This is a one-time step in the npm UI and cannot be done from CI. Without it the token exchange keeps returning the 404 above.

npmjs.com → exostate → Settings → Trusted Publisher:

Field Value
Organization / user webcoderspeed
Repository exostate
Workflow filename ci.yml
Environment (leave blank)

Merging before that step is configured will simply fail the release job again — nothing is published and nothing is damaged.

The release job on master failed:

  OIDC token exchange with the npm registry failed:
  404 OIDC token exchange error - package not found
  ENONPMTOKEN No npm token specified.

semantic-release v25 does attempt trusted publishing, so the fix is to remove
the token fallback and satisfy the two things OIDC actually needs:

- Drop the NPM_TOKEN env from both release paths. No long-lived credential.
- Add registry-url to setup-node so the registry is configured for auth.
- Upgrade npm before publishing: trusted publishing requires npm >= 11.5.1 and
  Node 22 ships npm 10.x.

Also fixes a second, independent blocker. The repository had no git tags at
all, and semantic-release derives the next version from tags rather than from
the registry — so it would have recomputed 1.0.0 and collided with the version
already on npm. Pushed a v1.0.1 baseline tag at 768d583, which is the commit
the published exostate@1.0.1 records as its gitHead, so the next release
computes 1.1.0 from the feat: commits that follow it.

package.json version synced to 1.0.1 to match the registry; semantic-release
overwrites it at release time.

Note: this still requires a trusted publisher to be configured for `exostate`
on npmjs.com, bound to this repository and workflow. That is a one-time step
in the npm UI and cannot be done from CI.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@webcoderspeed, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bc6d8e25-9107-412b-be98-059bf622c27c

📥 Commits

Reviewing files that changed from the base of the PR and between 64d19c0 and 2a43cab.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • CONTRIBUTING.md
  • package.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@webcoderspeed
webcoderspeed merged commit 19f5265 into master Aug 5, 2026
10 checks passed
@webcoderspeed
webcoderspeed deleted the ci/npm-trusted-publishing branch August 5, 2026 20:22
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

🎉 This issue has been resolved in version 1.1.0.
Install it: npm install exostate@1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant