ci: publish to npm via OIDC trusted publishing - #11
Merged
Conversation
Drop the long-lived NPM_TOKEN in favor of npm trusted publishing (OIDC), which @semantic-release/npm v13 supports via the id-token: write permission already granted to the job. This removes the recurring token-expiry failure mode and enables automatic provenance. Also upgrade npm in the runner to a version that supports trusted publishing (Node 22 still ships npm 10; OIDC needs >= 11.5.1). Requires a matching trusted publisher configured on the npm package. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
What
Switch npm publishing from a long-lived
NPM_TOKENto OIDC trusted publishing.NPM_TOKENfrom the Release step —@semantic-release/npmv13 authenticates via OIDC using theid-token: writepermission (already granted).Why
The previous token-based release kept failing (
EINVALIDNPMTOKEN) because the long-lived token expired. OIDC removes this failure mode entirely, and long-lived publish tokens are being deprecated (publishing via such tokens is removed around January 2027).A trusted publisher must be configured on the npm package (
@qwant/answer) pointing to this repo +release.yml, otherwise the OIDC publish will fail. Merge only once that is in place.🤖 Generated with Claude Code