feat(code-review): 增加 request_copilot_review 开关,支持按仓库关闭 Copilot review#29
Conversation
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>
There was a problem hiding this comment.
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_callboolean inputrequest_copilot_review(defaulttrue). - Gate the “Request Copilot review” step with
if: github.event_name != 'workflow_call' || inputs.request_copilot_reviewso 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.
|
| 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
Reviews (1): Last reviewed commit: "feat(code-review): add request_copilot_r..." | Re-trigger Greptile
变更概述
code-review.yml新增workflow_call输入request_copilot_review(boolean,默认true)if: github.event_name != 'workflow_call' || inputs.request_copilot_reviewrequest_copilot_review: false即可只保留 Claude review、不再--add-reviewer @copilot行为说明
pull_request触发(本仓自身 PR)不受影响,照常请求 Copilottaptap/maker将传false(见对应 PR)测试计划
🤖 Generated with Claude Code