ci(release): switch to npm Trusted Publishing via OIDC#29
Merged
Conversation
Add id-token: write permission so GitHub Actions can mint short-lived OIDC tokens for the job, and drop the long-lived NPM_TOKEN env. Each package must have a Trusted Publisher configured on npm pointing to MyPrototypeWhat/context-chef and workflow release.yml. Fixes ERR_PNPM_OTP_NON_INTERACTIVE caused by 2FA "auth and writes" requiring an OTP that CI cannot provide with a non-automation 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
Release workflow was failing with
ERR_PNPM_OTP_NON_INTERACTIVE— npm 2FA "auth and writes" requires an OTP on publish, which a non-Automation token cannot satisfy in a non-interactive CI shell. Earlier 404s were the same auth path failing differently before the token rotation.Versions
core@3.5.0,ai-sdk-middleware@1.3.5,tanstack-ai@0.4.5were bumped on main (#28) but never published as a result.What
id-token: writeto the release job so GitHub Actions can mint a short-lived OIDC token.NPM_TOKENenv — pnpm will use OIDC to authenticate against npm.Prereq (done on npm side)
Trusted publishers configured on each of
@context-chef/core,@context-chef/ai-sdk-middleware,@context-chef/tanstack-aipointing toMyPrototypeWhat/context-chefworkflowrelease.yml.After merge
Release workflow runs on main with no pending changesets →
pnpm changeset publishpublishes the three.5versions via OIDC, with provenance attestation.Generated by Claude Code