npm: publish via OIDC trusted publishing - #152
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe release workflow now uses Node.js 24 and npm provenance without supplying a long-lived NPM token, enabling OIDC-based trusted publishing through the configured npm registry. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/release.yml" line_range="46" />
<code_context>
- uses: actions/setup-node@v4
with:
- node-version: 20
+ node-version: 24
registry-url: https://registry.npmjs.org
</code_context>
<issue_to_address>
**issue (bug_risk):** Setting only `node-version: 24` does not guarantee an npm version that supports trusted publishing; the initial Node 24 releases bundled npm 11.3.x, while npm OIDC trusted publishing requires npm 11.5.1 or newer, so `npm publish` fails authentication instead of publishing.
**Triggers:** When the resolved Node 24 distribution bundles npm older than 11.5.1.
**Suggested fix:** Install or invoke npm 11.5.1 or newer explicitly, or pin a Node release whose bundled npm satisfies that requirement.
```suggestion
node-version: 24.5.0
```
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and this changes how the release workflow authenticates to npm, replacing a stored token with OIDC-based trusted publishing. If the trust configuration is wrong, publishing may fail and reverting restores the token path, but a mis-scoped identity could also allow an unintended workflow to publish a package that cannot be fully removed from npm.
Blocking findings: .github/workflows/release.yml:46
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| node-version: 24 |
There was a problem hiding this comment.
issue (bug_risk): Setting only node-version: 24 does not guarantee an npm version that supports trusted publishing; the initial Node 24 releases bundled npm 11.3.x, while npm OIDC trusted publishing requires npm 11.5.1 or newer, so npm publish fails authentication instead of publishing.
Triggers: When the resolved Node 24 distribution bundles npm older than 11.5.1.
Suggested fix: Install or invoke npm 11.5.1 or newer explicitly, or pin a Node release whose bundled npm satisfies that requirement.
| node-version: 24 | |
| node-version: 24.5.0 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6e97fa8e6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| node-version: 24 |
There was a problem hiding this comment.
Install an npm release that supports trusted publishing
In the npm-publish job, selecting Node 24 does not ensure the required npm CLI version: the current Node v24.15.0 distribution inspected here bundles npm 11.4.2, while npm's trusted-publishing prerequisites require npm CLI 11.5.1 or later. On a tag release using that distribution, this CLI cannot exchange the GitHub OIDC token and, now that NODE_AUTH_TOKEN is removed, npm publish fails authentication; explicitly install npm >=11.5.1 or pin a Node release verified to bundle it.
Useful? React with 👍 / 👎.
Summary by Sourcery
Migrate npm releases from token-based authentication to OIDC trusted publishing.
Enhancements:
Build: