ci: publish to npm via trusted publishing - #19
Merged
Conversation
Grants id-token: write so @semantic-release/npm can exchange a GitHub OIDC token for a short-lived registry token. NODE_AUTH_TOKEN remains the fallback, so this is inert until the trusted publisher is registered on npmjs.com.
DEPLOY_PAT existed only so @semantic-release/git could push the release commit past the two-stage ruleset. Bypassing that ruleset for the GitHub Actions app removes the need for any personal credential, matching turbo-sdk, which runs the same release on the plain GITHUB_TOKEN.
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.
Why
NPM_TOKENand the now-deadDEPLOY_PATwere both set on 2026-06-11. The 1.0.2 release failed at the git push, before the publish step ever ran — so there is currently no evidenceNPM_TOKENis still valid. Long-lived registry credentials are the failure mode that just cost us a release.What
Grants
id-token: writeto thereleasejob.@semantic-release/npm@13.1.5already supports npm trusted publishing natively: it detects GitHub Actions, callsgetIDToken("npm:registry.npmjs.org"), and exchanges it for a short-lived publish token. Publishes made this way also carry a provenance attestation.Safety
verify-auth.jsshort-circuits only when the OIDC exchange succeeds:NODE_AUTH_TOKENis left in place, so if the trusted publisher is not yet registered the plugin logs a failed exchange and falls back to the token exactly as today. This PR is therefore inert until the npmjs.com side is configured, and drops the token dependency the moment it is.Follow-up (not in this PR)
@ar.io/deployon npmjs.com: repoar-io/ar-io-deploy, workflowrelease.yml.NPM_TOKENsecret and theNODE_AUTH_TOKENline.actions/checkout@v4,setup-node@v4andpnpm/action-setup@v4are forced onto Node 24.