♻️ refactor(ci): post PR reviews as inline threaded comments#82
Merged
Conversation
Rework the Claude Code Review workflow to submit a single review with
per-line inline comments (severity-tagged 🔴/🟡/🔵) and a structured
summary body, instead of one monolithic PR comment.
Why:
- Inline comments attach feedback to the exact lines it concerns,
matching the workflow already used by .claude/commands/review_pr.md.
- A single review carries a clear verdict (REQUEST_CHANGES / APPROVE /
COMMENT) derived from the highest-severity finding.
Changes:
- Replace the prompt with review criteria, inline-comment schema, a
single-call submission recipe via `gh api POST /pulls/.../reviews`,
and a summary-body template.
- Drop redundant `gh pr view` / `gh pr diff` steps — PR context is
already provided by claude-code-action; use ${{ github.repository }}
and ${{ github.event.pull_request.head.sha }} instead.
- Bump `pull-requests` permission from `read` to `write` so the job
can POST the review.
- Allow `Bash(gh api:*)` in claude_args.
- Add `Bash(git checkout -b *)` to local settings allowlist.
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Pull Request
Description
Rework the
Claude Code ReviewGitHub Action to submit one PR review with per-line inline comments (severity-tagged 🔴 CRITICAL / 🟡 SUGGESTION / 🔵 QUESTION) plus a structured summary body — instead of posting one monolithic PR comment.This mirrors the flow already defined in
.claude/commands/review_pr.mdso local/review_prinvocations and the automated CI review produce the same shape of feedback.What changed
gh api POST /repos/.../pulls/.../reviewswithcommits[],body, andevent, so the review is atomic and carries a verdict.claude-code-actionalready injects PR title/body/diff/changed files; dropped thegh pr view/gh pr diffsteps and use${{ github.repository }}+${{ github.event.pull_request.head.sha }}directly.pull-requests: read→write(required to POST a review).Bash(gh api:*)toclaude_args; addedBash(git checkout -b *)to local settings.Type of Change
Testing
N/A — CI workflow change. Validation will happen on the next PR where the workflow runs; the review body / inline comments / verdict should appear as one GitHub review rather than a plain comment.
Code Quality
pre-commit run --all-files)ruff check src/ tests/)ruff format src/ tests/ --check)Related Issues
N/A
Additional Notes
pull-requests: write. If branch-protection rules limit what theGITHUB_TOKENcan do from forked PRs, reviews on fork PRs may need to run withpull_request_target(not changed here — scoped intentionally).Bash(gh api:*)is needed for the new flow; the oldergh pr commententry is retained in the allowlist for backward compatibility with any other prompts in the repo.Checklist for Reviewers:
pull-requests: writescope)🤖 Generated with Claude Code