ci: migrate release to npm Trusted Publishing (OIDC) + GitHub App token#640
Merged
Conversation
Replace long-lived secrets in the release pipeline: - npm: drop NPM_TOKEN and the hand-written ~/.npmrc; publish via npm Trusted Publishing (OIDC). The job already had `id-token: write`, and the trusted publisher for @ladle/react is configured on npmjs.com. Add `registry-url` and force `npm@latest` since OIDC needs npm >= 11.5.1 and the runner's bundled npm can be older. - git: replace the GIT_DEPLOY_KEY PAT with a scoped, short-lived GitHub App installation token (actions/create-github-app-token@v3), passed to both checkout and changesets/action. App-token pushes still trigger downstream workflows, so the Version Packages PR keeps re-triggering the release. New repo secrets: RELEASE_BOT_APP_ID, RELEASE_BOT_PRIVATE_KEY. NPM_TOKEN and GIT_DEPLOY_KEY can be revoked once the first run is verified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LucaCorcella
left a comment
There was a problem hiding this comment.
Hi, after your pr the release process filed
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.
Removes the two long-lived secrets from the release pipeline.
npm:
NPM_TOKEN→ Trusted Publishing (OIDC)~/.npmrcstep andNPM_TOKENfrom both publish steps.id-token: write, and the trusted publisher for@ladle/reactis configured on npmjs.com (repotajo/ladle+ this workflow file).registry-urland anpm install -g npm@lateststep — OIDC needs npm ≥ 11.5.1 and the runner's bundled npm can be older. (changeset publishandpublish-next.jsboth shell out to the systemnpm.)git:
GIT_DEPLOY_KEYPAT → GitHub App tokenactions/create-github-app-token@v3, passed to bothcheckoutandchangesets/action.Secrets
RELEASE_BOT_APP_ID,RELEASE_BOT_PRIVATE_KEY(already configured).NPM_TOKEN(also revoke on npmjs.com) andGIT_DEPLOY_KEY(also delete the PAT).Rollout / verification
After merge, watch the first release run and confirm:
Only then revoke
NPM_TOKEN/GIT_DEPLOY_KEY— there is no token fallback left in the workflow, so keep them until the first run is green.Also incidentally resolves the stale
node-versionconcern: the job runs on24.x(≥ 22.14 required by OIDC, and satisfies rootengines.node >=22.12.0).🤖 Generated with Claude Code