feat: bot 起点 PR でも自動レビューを許可 (allowed_bots)#120
Merged
Conversation
Claude Tag(Slack から PR 作成)で作られた PR は actor が bot(claude) となり、claude-code-action の bot ガードで 'Workflow initiated by non-human actor' として弾かれていた。 reusable の claude-review.yml に allowed_bots 入力を追加し、 claude-code-action へ渡す。デフォルトは 'claude' で Claude Tag 由来の PR を許可する。呼び出し側で fork は除外済みのため surface は限定的。 必要に応じて呼び出し側で '*' 等に変更可能。 Co-authored-by: Claude <noreply@anthropic.com>
fumikito
enabled auto-merge (squash)
July 16, 2026 12:12
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.
背景
Claude Tag(Slack から PR を作成する機能)で作られた PR で、CI 通過後の自動レビューが失敗していた。
原因は auto-review 側のフィルタではなく、
anthropics/claude-code-action@v1の bot ガード:```
Action failed with error: Workflow initiated by non-human actor: claude (type: Bot).
Add bot to allowed_bots list or use '*' to allow all bots.
```
(例: https://github.com/tarosky/hamelp/actions/runs/29492545366/job/87601887395 — auto-review ジョブは起動し、
Run Claude Code Reviewステップで失敗)action は bot 起点のワークフローを既定で拒否する(bot ループ防止)。actor 判定は
allowed_botsを小文字化+[bot]除去して比較するため、claudeを許可すればよい。変更内容
claude-review.ymlにallowed_bots入力を追加(デフォルトclaude)anthropics/claude-code-action@v1にallowed_bots: \${{ inputs.allowed_bots }}を渡す影響 / 安全性
@mainを参照する全プラグインで、Claude Tag 由来 PR の自動レビューが動くようになる(呼び出し側の変更は不要)head_repository != github.repository)は除外済み。actor login は GitHub 付与で詐称不可。許可対象は「当該リポにインストールされた claude bot が push した同一リポ PR」に限定されるallowed_bots: '*'等を指定可能(public repo での'*'警告は wiki に明記)検証
src/github/validation/actor.tsの判定ロジックを確認し、allowed_bots: "claude"が正規化後claudeと一致することを確認済み🤖 Generated with Claude Code