Skip to content

feat(code-review): 增加 request_copilot_review 开关,支持按仓库关闭 Copilot review#29

Merged
lishuceo merged 1 commit into
mainfrom
feat/code-review-copilot-toggle
Jun 10, 2026
Merged

feat(code-review): 增加 request_copilot_review 开关,支持按仓库关闭 Copilot review#29
lishuceo merged 1 commit into
mainfrom
feat/code-review-copilot-toggle

Conversation

@lishuceo

Copy link
Copy Markdown
Contributor

变更概述

  • reusable workflow code-review.yml 新增 workflow_call 输入 request_copilot_review(boolean,默认 true
  • 「Request Copilot review」步骤增加 if: github.event_name != 'workflow_call' || inputs.request_copilot_review
  • 调用方传 request_copilot_review: false 即可只保留 Claude review、不再 --add-reviewer @copilot

行为说明

  • 默认不变:未传该输入的调用方仍会请求 Copilot
  • 直接 pull_request 触发(本仓自身 PR)不受影响,照常请求 Copilot
  • 首个消费方taptap/maker 将传 false(见对应 PR)

测试计划

  • merge 后,maker 侧 PR 的 Code Review workflow 不再添加 @copilot,Claude review 正常运行
  • 其它未改动的调用仓 Copilot review 行为保持不变

🤖 Generated with Claude Code

Reusable callers can now pass `request_copilot_review: false` to skip the
"Request Copilot review" step (e.g. repos that only want Claude review).
Defaults to true; direct pull_request runs are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

This PR adds a per-repository opt-out switch for requesting a Copilot review when code-review.yml is used as a reusable workflow, while keeping the default behavior unchanged (still requests Copilot unless explicitly disabled).

Changes:

  • Add a new workflow_call boolean input request_copilot_review (default true).
  • Gate the “Request Copilot review” step with if: github.event_name != 'workflow_call' || inputs.request_copilot_review so reusable callers can disable adding @copilot.
  • Preserve existing behavior for direct pull_request-triggered runs (still requests Copilot).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown

Greptile Summary

此 PR 为可复用 workflow code-review.yml 新增 request_copilot_review 布尔输入(默认 true),允许调用方通过传入 false 来跳过 Copilot reviewer 的添加,同时保持 Claude review 正常运行。

  • 新增 workflow_call 输入 request_copilot_review(boolean,默认 true),未传值的调用方及直接 pull_request 触发时行为不变。
  • "Request Copilot review" 步骤添加 if: ${{ github.event_name != 'workflow_call' || inputs.request_copilot_review }},逻辑覆盖三种场景(直接触发、workflow_calltrueworkflow_callfalse)均正确。

Confidence Score: 5/5

变更最小,仅新增一个带默认值的可选输入和一个步骤级 if 条件,对所有现有调用方无副作用,可安全合并。

改动仅涉及一个新的可选 boolean 输入(默认 true)和一行 if 条件,三种触发路径的逻辑均正确:直接 pull_request 触发照常请求 Copilot,workflow_call 未传参时默认行为不变,传 false 时正确跳过该步骤。无破坏性变更,无遗漏边界情况。

无需特别关注的文件,唯一改动的 .github/workflows/code-review.yml 变更简洁明确。

Important Files Changed

Filename Overview
.github/workflows/code-review.yml 新增 request_copilot_review 布尔输入(默认 true),并在 "Request Copilot review" 步骤上添加正确的 if 条件,逻辑完整,默认行为不受影响。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[触发事件] --> B{event_name?}
    B -- pull_request --> C["github.event_name != 'workflow_call' → true"]
    B -- workflow_call --> D{inputs.request_copilot_review?}
    C --> E[✅ 执行: --add-reviewer @copilot]
    D -- true default --> E
    D -- false --> F[⏭️ 跳过 Copilot review 步骤]
    E --> G[继续: Checkout & Claude review]
    F --> G
Loading

Reviews (1): Last reviewed commit: "feat(code-review): add request_copilot_r..." | Re-trigger Greptile

@lishuceo lishuceo merged commit bbfdb5a into main Jun 10, 2026
5 of 6 checks passed
@lishuceo lishuceo deleted the feat/code-review-copilot-toggle branch June 10, 2026 06:00
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