feat(release): publish to npm without a token, via OIDC - #123
Merged
Conversation
@navbytes/vee now publishes through npm trusted publishing: the registry verifies this workflow's OIDC identity rather than a stored credential. The package is configured to trust navbytes/vee's release.yml and nothing else. This removes a credential that had to be created, stored, and rotated every 90 days — npm caps write tokens there, with no "never expires" option — and whose lapse would have surfaced as a failed release next quarter. It also removes the failure mode that broke 0.3.0's first attempt twice over. A granular token without 2FA bypass is rejected outright (EOTP), which no CI can answer. A token *with* bypass gets its publishes staged for manual confirmation instead of going live, which is why 0.3.0 reported a successful publish while the registry returned "Not found". npm is restricting bypass tokens for direct publishing anyway, so the token path was on its way out regardless. Provenance is attested automatically under OIDC, so the explicit --provenance flag is gone. id-token: write is still required and already granted. NPM_TOKEN is deliberately left in the repository secrets until a release proves OIDC works; it is unused from this commit on and should be deleted after that. Claude-Session: https://claude.ai/code/session_0159CBiPNW97Nnn9oDyk7VyP
navbytes
force-pushed
the
npm-trusted-publishing
branch
from
August 23, 2026 16:00
89a0caf to
c4048a0
Compare
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.
Summary
@navbytes/veenow publishes through npm trusted publishing. The registryverifies this workflow's OIDC identity instead of a stored credential, so there
is no
NPM_TOKENto leak, to rotate, or to forget.Configured on the package: publisher GitHub Actions, repository
navbytes/vee, workflow release.yml, permission
npm publish.Nothing else can publish it.
Why, beyond tidiness
v0.3.0failed to publish twice, both times because of how npm treats tokens:npm error code EOTP: This operation requires a one-time password. No CI can answerthat.
That is why the job reported
+ @navbytes/vee@0.3.0while the registryreturned
{"error":"Not found"}— the package existed with zero versions.npm is restricting bypass tokens for direct publishing regardless (it warns
about it in the publish output), so the token path was on its way out. OIDC
sidesteps all of it.
It also removes a 90-day expiry. npm caps write tokens there with no "never
expires" option, so the token was guaranteed to lapse and take a future release
with it — the same shape as the Homebrew tap sitting two releases stale.
Changes
NODE_AUTH_TOKENand the missing-token guard are gone; there is no credentialto check for.
--provenancedropped — attestation is automatic under OIDC. Verified the0.3.0 publish already carries a SLSA provenance predicate.
id-token: writeunchanged; it is what OIDC needs.live rather than failing on it.
Requirements met
npm trusted publishing needs npm >= 11.5.1. Node 24 ships npm 11.17, and the
job already pins
node-version: 24.Follow-ups, deliberately not in this PR
NPM_TOKENafter a release proves OIDC works. Left in place fornow so there is a fallback if something is misconfigured.
authentication and disallow bypass 2fa tokens". npm notes trusted publishers
keep working under any setting and recommends the most restrictive one — but
sequencing matters: prove OIDC first, then remove the other door.
Type of change
Testing done
release.ymlvalidated as YAML; noNPM_TOKENreference remains.@navbytes/vee@0.3.0is live, installs, and all three builders workfrom the published package.
The publish path itself is only exercised by a real release — that is the next
one.
https://claude.ai/code/session_0159CBiPNW97Nnn9oDyk7VyP