Skip to content

ci(release): authenticate as ccpluginizer-release-bot GitHub App#22

Merged
lifebugz merged 1 commit into
mainfrom
ci/release-bot-app-token
May 11, 2026
Merged

ci(release): authenticate as ccpluginizer-release-bot GitHub App#22
lifebugz merged 1 commit into
mainfrom
ci/release-bot-app-token

Conversation

@lifebugz
Copy link
Copy Markdown
Owner

Summary

Makes the release workflow authenticate as a dedicated GitHub App (`ccpluginizer-release-bot`) instead of using the default `GITHUB_TOKEN`. Fixes the bot-PR-checks-never-run trap. Also bumps `actions/setup-node` to v6 to silence the Node 20 deprecation warning.

The trap this fixes

PR #21 demonstrated it: `changesets/action` opened the v0.5.0 release PR using `GITHUB_TOKEN`, but GitHub's safety policy blocks events from triggering downstream workflows when initiated via `GITHUB_TOKEN`. Result: `validate` + `changeset-check` never ran on PR #21, but branch protection (added in #19) requires them, so the PR was unmergeable except via admin override.

The App-token flow uses a non-`GITHUB_TOKEN` identity, which falls outside that safety policy. Future release PRs will trigger their own CI normally and merge through the standard "checks green → click merge" flow.

Changes to `release.yml`

  1. New first step: `actions/create-github-app-token@v2` mints an installation token from the App's credentials.

  2. Checkout uses the App token: `actions/checkout@v6` now receives `token: ${{ steps.app-token.outputs.token }}`, so subsequent git operations are authenticated as the App. Required for commits the changesets action makes during `bun ci:version`.

  3. Changesets uses the App token: `GITHUB_TOKEN` env in the `changesets/action@v1` step now uses the App token instead of the default. This is what causes PRs opened by changesets to count as App-authored and trigger downstream workflows.

  4. `actions/setup-node@v4` → `@v6`: silences the Node 20 deprecation warning. v6.4.0 runs on Node 24 (the runner's default starting June 2026).

App configuration (already set up out-of-band)

  • App: `ccpluginizer-release-bot` (private, owned by lifebugz, installed only on lifebugz/ccpluginizer)
  • Permissions: `contents:write`, `pull-requests:write`, `metadata:read` — nothing more
  • Webhook: disabled
  • Secrets in repo: `RELEASE_BOT_APP_ID`, `RELEASE_BOT_PRIVATE_KEY`

Test plan

  • Empty changeset present (CI config, no published-package impact)
  • Workflow YAML syntax OK locally
  • Required secrets visible in `gh secret list` for this repo
  • Post-merge verification: next release PR (whatever triggers it) is authored by `ccpluginizer-release-bot[bot]` and triggers its own `validate` + `changeset-check` jobs

Previously, release.yml used the default GITHUB_TOKEN for both the
changesets action (which opens version-packages PRs) and for git
operations during checkout. Two problems with that:

1. GitHub's safety policy prevents downstream workflows from being
   triggered by events that GITHUB_TOKEN initiated. So when changesets
   opened a release PR, validate.yml and changeset-check did not run
   on it, leaving required checks permanently pending. Combined with
   the branch protection added in #19, release PRs became unmergeable
   without admin-override.

2. GITHUB_TOKEN is scoped per-workflow-run and can't be reused for
   long-running automation.

Switching to a dedicated GitHub App (ccpluginizer-release-bot) fixes
both. PRs opened by the App are authored by an entity that is *not*
GITHUB_TOKEN, so they trigger their own CI like normal. The App has
exactly contents:write + pull-requests:write + metadata:read scopes
— nothing more — and is installed only on this repo.

Also: bump actions/setup-node from v4 to v6 to silence the Node 20
deprecation warning. The v6.4.0 line runs on Node 24, the runner's
default starting June 2026.

Empty changeset (CI config change, no published-package impact).
@lifebugz lifebugz merged commit 6c18ed0 into main May 11, 2026
2 checks passed
@lifebugz lifebugz deleted the ci/release-bot-app-token branch May 11, 2026 00:22
@lifebugz lifebugz mentioned this pull request May 21, 2026
4 tasks
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.

1 participant