-
Notifications
You must be signed in to change notification settings - Fork 18
chore: streamline Claude GitHub Actions workflow #516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove automatic PR review workflow in favor of on-demand reviews via @claude mentions. Add CLAUDE.md with project context and code review guidelines. Grant pull-requests write permission to enable structured reviews with gh pr review.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude please review |
|
Claude finished @alexluong's task —— View job Code Review Complete ✓I've reviewed the PR that streamlines the Claude GitHub Actions workflow. Here's my feedback: Tasks
SummaryThis PR consolidates the Claude workflow setup by removing an automatic code review workflow and enabling manual @claude mentions to handle reviews instead. Overall, this is a good simplification. Changes Reviewed✅
|
|
@claude can you update the claude.yml file, loosely based on your suggestion and this example https://github.com/anthropics/claude-code-action/blob/main/examples/pr-review-comprehensive.yml? |
|
Claude finished @alexluong's task —— View job Updating claude.ymlTasks
Important NoteI cannot directly modify files in the Recommended Updated ConfigurationBased on your request, my previous review, and best practices for comprehensive PR reviews, here's the updated name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for better context in reviews
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# Allow Claude to read CI results on PRs
additional_permissions: |
actions: read
# Enable gh CLI commands for structured PR reviews
claude_args: |
--allowed-tools "Bash(gh pr:*)"
--allowed-tools "Bash(git:*)"Key Changes Made
How to ApplySince I cannot modify workflow files directly, please:
This will enable the functionality described in CLAUDE.md and align with comprehensive PR review best practices. |
Add track_progress for visual review updates, enable inline PR comments via MCP tool, and expand permissions to support comprehensive code reviews and issue management.
|
@claude please review again and try |
|
Claude finished @alexluong's task —— View job Code Review & Testing gh pr FunctionalityTasks
Testing Resultsgh pr Command Status: ❌ Commands require approval I attempted to test claude_args: '--allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr review:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*)"'These permissions may not be fully active yet, or there may be an additional configuration needed in the repository settings or action configuration. Code ReviewI've thoroughly reviewed the changes in this PR. Here's my comprehensive feedback: ✅
|
@claude How would it work after this PR is merged but not before? I'm not 100% sure I understand the permission here yet. |
|
Claude finished @alexluong's task —— View job Clarifying Permission BehaviorTasks
Great Question! Here's What's HappeningYou're right to be confused - I was actually wrong in my previous comment. The permissions won't work differently after merge. Let me clarify: The Real IssueThe claude_args: '--allowed-tools "...,Bash(gh pr review:*),..."'However, when I tried to run Why Commands Are BlockedThe blocking isn't about the workflow YAML permissions - it's about the
The MisunderstandingIn my previous comment, I incorrectly suggested that merging would fix this. That was wrong. The approval mechanism will likely persist after merge since it's a runtime safety feature, not a configuration issue. What You Should KnowThe current configuration is correct - you've properly specified the allowed tools. The approval requirement is actually a feature, not a bug. It prevents automated scripts from running potentially destructive GitHub CLI commands without oversight. If you want Claude to use
The good news is that the inline comment tool ( Bottom line: This PR is correctly configured. The approval prompt is likely intentional for security. After merge, the behavior will be the same as it is now on this PR. |
|
@claude can you try to make a PR comment or review? Seems |
|
Claude finished @alexluong's task —— View job Testing Inline Comment FunctionalityTasks
FindingsI've tested the inline comment functionality and here's what I discovered: ❌ Inline Comment Tool Not AvailableThe Available GitHub MCP Tools:
Missing Tools:
Why This MattersThe workflow configuration lists the inline comment tool in
Current Review CapabilitiesBased on the available tools, here's what I can do for PR reviews: ✅ What Works:
❌ What Doesn't Work:
RecommendationFor now, the best approach for PR reviews is what I did in my previous review comments:
This provides similar value to inline comments, just in a different format. Should You Update CLAUDE.md?Yes, I recommend updating Current (doesn't work): - Use `gh pr review` to submit structured reviews with inline comments on specific linesSuggested Update: - Provide structured reviews in comments with file paths and line numbers
- Reference specific locations using the format `file_path:line_number`
- Include code snippets with context for claritySummary: The inline comment MCP tool is not currently available, and |
No description provided.