Skip to content

Publish with trusted publishing and keep draft runs as drafts - #6

Merged
ScottMorris merged 1 commit into
mainfrom
ci/trusted-publishing
Oct 15, 2026
Merged

ScottMorris merged 1 commit into
mainfrom
ci/trusted-publishing

Conversation

@ScottMorris

Copy link
Copy Markdown
Contributor

Summary

  • Trusted publishing. The publish job drops NPM_TOKEN, installs npm 11.5.1 or newer, and publishes with GitHub's OIDC identity, which is trusted on npm for liminal-hq/jax, workflow release.yml, environment npm-publish. This avoids depending on a stored token ahead of npm ending direct publishing for bypass-2FA tokens (January 2027).
  • Draft runs stay drafts. The attach step now passes draft, so a manual run with release_draft set to true no longer publishes the GitHub release and creates the tag.

Known limitations

  • Trusted publishing is untested until the next release; keep the NPM_TOKEN secret until it has worked once, then delete the secret and revoke the token.

Test plan

  • Workflow still parses; bun run format:check
  • CI is green on this pull request
  • After merge: run the Release workflow with release_draft set to true and check the release stays a draft
  • Publish the next version and confirm provenance and the OIDC publish

…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.
@ScottMorris ScottMorris added the ci Continuous integration workflows and checks label Oct 15, 2026
@ScottMorris
ScottMorris merged commit 04645ae into main Oct 15, 2026
5 checks passed
@ScottMorris
ScottMorris deleted the ci/trusted-publishing branch October 15, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration workflows and checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant