Repository navigation
Publish with trusted publishing and keep draft runs as drafts - #6
Merged
Merged
Conversation
…as drafts **Summary** - The publish job no longer uses `NPM_TOKEN`: it installs npm 11.5.1 or newer and publishes with the job's OIDC identity, which npm trusts for `liminal-hq/jax` through `release.yml` and the `npm-publish` environment. - A manual run with `release_draft` set to true now leaves the GitHub release as a draft. **Why** - npm is restricting tokens that bypass two-factor authentication, ending their direct publishing in January 2027, so the workflow should not depend on a stored token. - The attach step did not pass a draft flag, so the dry run published the GitHub release and created the tag. **Details** - `id-token: write` and the `npm-publish` environment were already in place; only the token variable is dropped and the npm upgrade step added. `--provenance` stays. - The attach step passes `draft` from the metadata job's `release_draft` output. **Notes** - The trusted publisher is configured on the package's npm settings page, not in this repository. This is exercised on the next release.
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
NPM_TOKEN, installs npm 11.5.1 or newer, and publishes with GitHub's OIDC identity, which is trusted on npm forliminal-hq/jax, workflowrelease.yml, environmentnpm-publish. This avoids depending on a stored token ahead of npm ending direct publishing for bypass-2FA tokens (January 2027).draft, so a manual run withrelease_draftset to true no longer publishes the GitHub release and creates the tag.Known limitations
NPM_TOKENsecret until it has worked once, then delete the secret and revoke the token.Test plan
bun run format:checkrelease_draftset to true and check the release stays a draft