✨ feat(code-review): add configurable model input - #37
Merged
Conversation
Add a `model` input (default `opus`) to the reusable code-review workflow
so consumer repos can pick their review model without forking the workflow.
Implements the `model` parameter from RFC 0001 Phase 1.
`--model opus` becomes `--model ${{ inputs.model || 'opus' }}`; the `|| 'opus'`
fallback keeps direct `pull_request` runs (where workflow_call inputs are
unset) on opus. Backward compatible — existing callers default to opus.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR enhances the shared code-review reusable workflow by making the Claude model configurable via a new workflow_call input, so consumer repositories can switch review models without duplicating the workflow.
Changes:
- Added a new
modelinput toworkflow_callinputs with defaultopus. - Updated Claude invocation to use the configured model instead of a hardcoded
opus.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
152
to
156
| claude_args: | | ||
| --model opus | ||
| --model ${{ inputs.model || 'opus' }} | ||
| --max-turns 256 | ||
| --allowedTools "Read,Glob,Grep,mcp__github_inline_comment__create_inline_comment,Bash(gh api repos/*/pulls/*/comments*),Bash(gh api graphql*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr checks:*),Bash(git log:*),Bash(git blame:*),Bash(git diff:*)" | ||
| env: |
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.
背景
共享 code-review workflow 把
--model opus写死,consumer repo 想换 review 模型只能整段抄走 workflow(放弃复用)。这是 RFC 0001 Phase 1 里model参数的落地。改动
modelinput(required: false,default: opus)。--model opus→--model ${{ inputs.model || 'opus' }}。|| 'opus'fallback 的必要性:该 workflow 同时被pull_request直接触发(review taptap/.github 自身 PR),此时workflow_call的 inputs 未填充,inputs.model为空——fallback 保证直接触发时仍走 opus。兼容性
完全向后兼容:所有现有 caller(未传
model)默认 opus,行为不变。首个消费方
maker 将传
model: fable-5(见 taptap/maker 侧 PR)。合并顺序:本 PR 需先合入 main,maker 侧 PR 才能生效(否则 maker 传一个 workflow 尚不认识的 input 会导致校验失败)。🤖 Generated with Claude Code