ci(release): switch npm publish to Trusted Publishers (OIDC), drop NPM_TOKEN - #195
Conversation
…M_TOKEN The NPM_TOKEN secret (a classic npm auth token) expired and broke the last release's publish step. npm Trusted Publishers is now configured for @webarkit/jsfeat-next on npmjs.com; this switches the workflow to use it. - Removed NODE_AUTH_TOKEN from the "Publish to npm" step. id-token: write was already present at the workflow level (added for provenance), so it didn't need adding -- the token was the only remaining blocker, and leaving it in would have kept shadowing the OIDC exchange even with trusted publishing configured on npm's side. - Added an "Update npm for trusted-publishing support" step (npm install -g npm@latest) right before publish: Trusted Publishers needs npm >= 11.5.1, and Node 24.18.0 (pinned in .nvmrc) bundles npm 10.9.4. Only the publish step needs the newer CLI, so install/build/test above still run on the pinned toolchain. - Updated MAINTAINERS.md's release runbook: replaced the NPM_TOKEN one-time-setup section with the Trusted Publisher configuration steps (provider, repo, workflow filename) and a note on what to check if publishing starts failing again (the Trusted Publisher config itself, not a token to rotate). Closes #194.
PR Summary by QodoSwitch npm releases to OIDC Trusted Publishing
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
…w npm publish Qodo's review of PR #195 caught a real gap: since Sep 3 2026 npm defaults a new Trusted Publisher configuration to allow npm stage publish only -- a two-phase flow requiring a maintainer to separately approve each release interactively (2FA, no OIDC) before it goes public. release.yml has no such approval step and calls npm publish directly, so following the runbook as written would leave the publish step failing on a missing permission instead of an expired token -- the exact class of problem #194/#195 set out to fix. Added the "Allowed actions: npm publish" instruction, with a note that npm stage publish's extra manual gate is worth considering later (e.g. if this project ever has more maintainers), but isn't what the current workflow implements.
Summary
Fixes #194. The
NPM_TOKENsecret (classic npm auth token) expired and broke the last release's publish step. npm Trusted Publishers is now configured for@webarkit/jsfeat-nexton npmjs.com; this switchesrelease.ymlto use it.NODE_AUTH_TOKENfrom the "Publish to npm" step.id-token: writewas already present at the workflow level (added for--provenance), so the token was the only remaining blocker — leaving it in would keep shadowing the OIDC exchange regardless of what's configured on npm's side.npm install -g npm@latest) right before publish: Trusted Publishers needs npm ≥ 11.5.1, and Node 24.18.0 (pinned in.nvmrc) bundles npm 10.9.4. Only the publish step needs the newer CLI.MAINTAINERS.md's release runbook: replaced theNPM_TOKENone-time-setup section with the Trusted Publisher configuration steps.Testing
This can't be exercised by CI (no tag push happens on this PR) — verification is a real tag push or
workflow_dispatchre-run against an existing tag, per #194's acceptance criteria, once this merges and a release is actually cut. Reviewed the diff for correct YAML indentation (matches the file's existing step structure) and confirmedprettier --checkpasses on both changed files.Closes #194.