Clarify Claude PR review prompt and fix head checkout#5364
Conversation
b08226b to
a54765d
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Claude PR-review workflow/prompting so the reviewer agent operates on the PR head commit (not the base branch when triggered via pull_request_target) and consolidates inline-comment guidance into the workflow.
Changes:
- Update
actions/checkout@v5to checkoutgithub.event.pull_request.head.shaso the job sees the PR’s head commit underpull_request_target. - Move/expand “how to review + how to comment” instructions into the workflow prompt and raise Claude max turns from 10 to 50.
- Remove duplicated “checked out” / inline-comment wording from
agents/pr-review.mdnow covered by the workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
agents/pr-review.md |
Removes duplicated checkout/inline-comment guidance so policy lives in the workflow prompt. |
.github/workflows/claude-review.yml |
Checks out PR head SHA and strengthens the embedded prompt + increases max turns / tool allowlist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
samliok
left a comment
There was a problem hiding this comment.
added the ai-label to the PR to see the output. Didn't know we already had claude reviews set up already.
Also what are max-turns?
That's how many agentic turns/tool-use cycles Claude can take before stopping. Setting a max is to avoid Claude potentially getting into a cycle where its wasting a bunch of tokens overthinking. Things like reading a file, running a diff is a tool call/turn. This run maxed the 10 turns. |
a54765d to
673561b
Compare
|
@JuanLeon1 |
Why this should be merged
actions/checkout@v5is checking out the PR head commit instead of master, which is the case when usingpull_request_target.How this works
actions/checkoutnow usesgithub.event.pull_request.head.shaso the job sees the PR head, not the base branch.gh pr view/gh pr diff, localRead/Grep/Glob/LS, andcreate_inline_comment;max-turnsis raised from 10 to 50.agents/pr-review.mddrops duplicated checkout/inline wording now covered by the workflow prompt. Workflow now includes only the workflow related agent prompts.How this was tested
Cannot be tested until this is merged.
Need to be documented in RELEASES.md?
No.