ci(release): switch publish step to npm trusted publishing - #42
Merged
Conversation
Drops the NODE_AUTH_TOKEN env var from the publish step. The job's existing 'id-token: write' permission is what GitHub needs to mint the OIDC token, which npm exchanges for a short-lived publish credential. Required (by the user, before or after merge): 1. Add a trusted publisher on npmjs.com for @deessejs/errors, pointing at deessejs/errors with workflow 'release.yml'. 2. Cut one release via the modified workflow to validate end-to-end. 3. On npmjs.com: Settings -> Publishing access -> 'Require 2FA and disallow tokens' (recommended maximum-security posture). 4. Revoke the NPM_TOKEN GitHub secret once the OIDC publish succeeds. Adds a changeset to pass the new ci.yml lint.
GitHub Environment gives us a deployment record per run, visible in the Deployments API and the GitHub UI. No protection rules are attached yet, so the trigger stays label-less / fire-on-every-merge. Future hardening (required reviewers, branch restrictions, wait timer, env secrets) can attach to the same environment without changing this workflow further. The environment on the npmjs.com trusted publisher config is intentionally left blank for now; we only point at the workflow file. Adding environment name on the trusted publisher side would require the env on the workflow to exist first, which it now does. Adds a changeset to pass the new ci.yml lint.
martyy-code
added a commit
that referenced
this pull request
Aug 3, 2026
…ronment) Adds Section 7 (Trusted publishing & environment) to the plan and a matching Appendix C (Post-plan decision log). Two items are added to the Definition of done: - At least one release has been published via npm trusted publishing (OIDC), per Section 7.1. - The GitHub 'release' environment exists with at least one deployment record, per Section 7.2. Plan Status also moves from 'Proposed' to 'Approved and partially implemented on staging' because Phases 3, 4, 5 plus Section 7 are now merged on the staging branch (PRs #40, #41, #42).
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
Switches the release workflow from
NPM_TOKEN(long-lived secret) to npm trusted publishing (OIDC). The job already hasid-token: writepermission, which is the only GitHub-side requirement. The publish step no longer passesNODE_AUTH_TOKEN.What changes
release.yml: thePublish packagesstep no longer has anenv: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}block.pnpm changeset publishnow relies on the OIDC token generated byid-token: write.Required before this is functional:
@deessejs/errors. Settings: GitHub Actions, repositorydeessejs/errors, workflow filenamerelease.yml, allowed actionsnpm publish.Recommended after the first OIDC publish works:
2. On npmjs.com:
Settings → Publishing access → "Require two-factor authentication and disallow tokens". This revokes any remaining token-based publish access; the OIDC trusted publisher is unaffected.3. Remove the
NPM_TOKENsecret from GitHub repo settings.Effects
🤖 Generated with Claude Code