auto-review: skip clean merge-only commits#101
Open
fumikito wants to merge 1 commit into
Open
Conversation
merge コミットでコンフリクト解決等の手動編集を含まない場合、auto-review (workflow_run トリガー) をスキップする。git diff-tree --cc の出力が空であることで判定。 is_manual: true で呼ばれた場合(@claude auto-review 等の手動トリガー)は常にレビューを実行する。 Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
claude-review.yml共有ワークフローにis_manualインプットを追加し、auto-review (workflow_run トリガー) でクリーンな merge-only コミットをスキップする preflight ステップを実装@claude auto-review等) でis_manual: trueを渡された場合は常にレビューを実行する背景
外部パートナー PR の運用で、
mainからのマージ・準備コミットなど 実質的な変更を含まない merge コミット に対して Claude がレビューを投稿してノイズになっていた(例: tarosky/motorfan-content#758 で merge-only コミットに対して複数のレビュー投稿が発生)。Anthropic API コストも無駄に発生していた。検出ロジック
is_manual == trueなら常にレビュー実行(手動の意思を尊重)git diff-tree --cc <head_sha>の出力が空(両親と異なる手動編集なし=クリーンマージ)→ スキップgit diff-tree --ccは両親と異なる内容を持つ箇所のみ出力するため、コンフリクト解決の手動編集が含まれる場合は出力が空にならず、レビューが走る設計。利用側の対応
is_manual: falseのため、利用側未更新でも auto-review のスキップは即時有効manual-reviewjob にis_manual: trueを追加する作業は別 PR で対応予定Test plan
claude-review.ymlをworkflow_runで呼ぶ self 設定がないため、本 PR 上で merge-only スキップは発火しない(@claudeアシスタント応答は可能)@claude auto-reviewの挙動は利用側へis_manual: trueを反映した別 PR 後に検証🤖 Generated with Claude Code