Skip to content

Commit 7e10804

Browse files
authored
Merge pull request openvanilla#709 from openvanilla/ci/claude_code_action_inline_review_comments
ci: enable Claude Code Action inline review comments with suggestions
2 parents e0a8cdf + f7ad0a2 commit 7e10804

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

.github/workflows/claude.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
permissions:
2222
contents: read
23-
pull-requests: read
23+
pull-requests: write # Required for posting inline review comments
2424
issues: read
2525
id-token: write
2626
actions: read # Required for Claude to read CI results on PRs
@@ -40,11 +40,24 @@ jobs:
4040
additional_permissions: |
4141
actions: read
4242
43-
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44-
# prompt: 'Update the pull request description to include a summary of changes.'
43+
# Enable inline review comments with suggestions for PR reviews
44+
# When @claude is mentioned in PR comments, it will provide detailed inline feedback
45+
prompt: |
46+
Please review this PR and provide inline feedback using the GitHub review system. Follow these steps:
4547
46-
# Optional: Add claude_args to customize behavior and configuration
47-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48-
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
49-
# claude_args: '--allowed-tools Bash(gh pr:*)'
48+
1. **Start a review**: Use `mcp__github__create_pending_pull_request_review` to begin a pending review
49+
2. **Get diff information**: Use `mcp__github__get_pull_request_diff` to understand the code changes and line numbers
50+
3. **Add inline comments**: Use `mcp__github__add_comment_to_pending_review` for each specific piece of feedback on particular lines
51+
4. **Submit the review**: Use `mcp__github__submit_pending_pull_request_review` with event type "COMMENT" (not "REQUEST_CHANGES") to publish all comments as a non-blocking review
52+
53+
When suggesting code changes, use GitHub's suggestion format with ```suggestion blocks so authors can apply changes directly.
54+
55+
# Enable GitHub MCP server tools for inline review comments
56+
# See: https://github.com/anthropics/claude-code-action/issues/60
57+
claude_args: >-
58+
--allowedTools
59+
mcp__github__create_pending_pull_request_review,
60+
mcp__github__get_pull_request_diff,
61+
mcp__github__add_comment_to_pending_review,
62+
mcp__github__submit_pending_pull_request_review
5063

0 commit comments

Comments
 (0)