Skip to content

ci: migrate release to npm Trusted Publishing (OIDC) + GitHub App token#640

Merged
tajo merged 1 commit into
mainfrom
worktree-oidc-release
Jun 28, 2026
Merged

ci: migrate release to npm Trusted Publishing (OIDC) + GitHub App token#640
tajo merged 1 commit into
mainfrom
worktree-oidc-release

Conversation

@tajo

@tajo tajo commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Removes the two long-lived secrets from the release pipeline.

npm: NPM_TOKEN → Trusted Publishing (OIDC)

  • Drop the hand-written ~/.npmrc step and NPM_TOKEN from both publish steps.
  • Publish authenticates via npm Trusted Publishing. The job already declared id-token: write, and the trusted publisher for @ladle/react is configured on npmjs.com (repo tajo/ladle + this workflow file).
  • Add registry-url and a npm install -g npm@latest step — OIDC needs npm ≥ 11.5.1 and the runner's bundled npm can be older. (changeset publish and publish-next.js both shell out to the system npm.)
  • Provenance attestations are now generated automatically.

git: GIT_DEPLOY_KEY PAT → GitHub App token

  • Replace the personal PAT with a scoped, short-lived installation token via actions/create-github-app-token@v3, passed to both checkout and changesets/action.
  • App-token pushes still trigger downstream workflows, so merging the "Version Packages" PR keeps re-triggering the release (the reason the custom PAT existed).

Secrets

  • Added: RELEASE_BOT_APP_ID, RELEASE_BOT_PRIVATE_KEY (already configured).
  • To revoke after the first successful run: NPM_TOKEN (also revoke on npmjs.com) and GIT_DEPLOY_KEY (also delete the PAT).

Rollout / verification

After merge, watch the first release run and confirm:

  • npm publish succeeds via OIDC (provenance shown in the log)
  • the App token opens/updates the Version Packages PR and pushes tags

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-version concern: the job runs on 24.x (≥ 22.14 required by OIDC, and satisfies root engines.node >=22.12.0).

🤖 Generated with Claude Code

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>
@tajo
tajo merged commit 592a3fc into main Jun 28, 2026
4 checks passed
@tajo
tajo deleted the worktree-oidc-release branch June 28, 2026 20:32

@LucaCorcella LucaCorcella left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, after your pr the release process filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants