Skip to content

ci: publish to npm via OIDC trusted publishing - #11

Merged
M-kasinski merged 1 commit into
mainfrom
ci/npm-trusted-publishing-oidc
Jul 16, 2026
Merged

ci: publish to npm via OIDC trusted publishing#11
M-kasinski merged 1 commit into
mainfrom
ci/npm-trusted-publishing-oidc

Conversation

@M-kasinski

Copy link
Copy Markdown
Collaborator

What

Switch npm publishing from a long-lived NPM_TOKEN to OIDC trusted publishing.

  • Remove NPM_TOKEN from the Release step — @semantic-release/npm v13 authenticates via OIDC using the id-token: write permission (already granted).
  • Upgrade npm in the runner to a version that supports trusted publishing (Node 22 ships npm 10; OIDC needs >= 11.5.1).
  • Provenance attestations are generated automatically.

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).

⚠️ Required before merge

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

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>
@M-kasinski
M-kasinski merged commit 691a847 into main Jul 16, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant