Skip to content

ci: use GitHub App token for release-please workflow#94

Merged
jun06t merged 2 commits into
masterfrom
ci/release-please-app-token
May 7, 2026
Merged

ci: use GitHub App token for release-please workflow#94
jun06t merged 2 commits into
masterfrom
ci/release-please-app-token

Conversation

@jun06t
Copy link
Copy Markdown
Owner

@jun06t jun06t commented May 7, 2026

概要

release-please workflow が使うトークンを GITHUB_TOKEN から GitHub App 発行のインストールトークンへ切り替えます。

背景

GITHUB_TOKEN で作られたタグや push は 他の workflow を起動しない 仕様です (docs)。release-please が自動で切るタグを起点に Docker build / デプロイ等の下流 workflow を発火させる典型パターンが、デフォルトのままでは成立しません。

GitHub App から発行したインストールトークンを使うとこの制約を回避でき、release-please が打ったタグから後続 workflow を連鎖起動できます。あわせて、リリース PR / タグ / GitHub Release の作成者が github-actions[bot] ではなく App 名 (例: release-please-bot[bot]) で表示されるようになり、ノイズ除外の指定 (CODEOWNERS / Greptile 等) もより明確になります。

変更内容

steps:
  - uses: actions/create-github-app-token@v1
    id: app-token
    with:
      app-id: ${{ secrets.RELEASE_PLEASE_APP_ID }}
      private-key: ${{ secrets.RELEASE_PLEASE_PRIVATE_KEY }}
  - uses: googleapis/release-please-action@v4
    with:
      token: ${{ steps.app-token.outputs.token }}
      ...

前提

リポジトリに以下の Secrets が設定済みであること (登録済み):

  • RELEASE_PLEASE_APP_ID
  • RELEASE_PLEASE_PRIVATE_KEY

GitHub App は本リポジトリにインストールされ、最低限以下の権限を持つこと:

  • Repository permissions: Contents: Read & write
  • Repository permissions: Pull requests: Read & write

テスト計画

  • 本 PR をマージする
  • release-please workflow が正常に成功する
  • (任意) 次のリリース PR の Author が App ([bot]) になっていることを確認する
  • (任意) リリース PR をマージし、タグの push をトリガーに別 workflow が起動できることを確認する

🤖 Generated with Claude Code

jun06t and others added 2 commits May 7, 2026 09:22
Replace the implicit GITHUB_TOKEN with a GitHub App-issued token so
that release PRs, merges, tags, and GitHub Releases produced by
release-please are attributed to the release-please bot instead of
github-actions[bot], and so that downstream workflows (e.g. tag-based
Docker build / deployment pipelines) can be triggered by the events
release-please emits.

Workflows triggered by GITHUB_TOKEN do not spawn additional workflow
runs, which blocks the natural pattern of "release-please cuts the
tag → tag push triggers Docker build". An installation token from a
GitHub App bypasses that restriction.

Required secrets:
- RELEASE_PLEASE_APP_ID:    the App ID of the GitHub App
- RELEASE_PLEASE_PRIVATE_KEY: the App's private key (PEM)

The App must be installed on this repository with at least these
permissions: contents: write, pull-requests: write.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace floating tag refs with full commit SHAs so that workflow inputs
cannot be silently changed by a tag re-point. Also bump release-please
to v5.0.0 (current latest) per request.

- actions/create-github-app-token v1 → v3.1.1
  (1b10c78c7865c340bc4f6099eb2f838309f1e8c3)
- googleapis/release-please-action v4 → v5.0.0
  (45996ed1f6d02564a971a2fa1b5860e934307cf7)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jun06t jun06t merged commit 0d624bd into master May 7, 2026
1 check passed
@jun06t jun06t deleted the ci/release-please-app-token branch May 7, 2026 00:25
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