Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Actions workflows to integrate Claude Code, an AI coding agent, into the repository. The integration enables two main features: interactive Claude assistance via @claude mentions in issues/PRs, and automated code reviews on new/updated pull requests.
Key Changes:
- Added interactive Claude workflow triggered by @claude mentions in comments and issues
- Added automated Claude code review workflow that runs on PR open/synchronize events
- Configured permissions, triggers, and tool restrictions for both workflows
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/workflows/claude.yml |
Main workflow enabling interactive Claude Code assistance via @claude mentions in PR/issue comments |
.github/workflows/claude-code-review.yml |
Automated workflow that triggers Claude to perform code reviews on all new or updated pull requests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/claude.yml
Outdated
| contents: read | ||
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
The claude workflow is missing write permissions required for Claude to actually perform actions. The current permissions only allow reading, but Claude needs to create branches, commits, and comments. Add pull-requests: write, issues: write, and contents: write to the permissions section.
| contents: read | |
| pull-requests: read | |
| issues: read | |
| contents: write | |
| pull-requests: write | |
| issues: write |
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
The claude-review workflow is missing write permissions needed for Claude to post code review comments. While the prompt instructs Claude to use gh pr comment, the workflow only has pull-requests: read permission. Add pull-requests: write and issues: write to enable Claude to post comments.
| pull-requests: read | |
| issues: read | |
| pull-requests: write | |
| issues: write |
.github/workflows/claude.yml
Outdated
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 |
There was a problem hiding this comment.
Setting fetch-depth: 1 creates a shallow clone that only includes the latest commit. This limits Claude's ability to understand the full context of changes, especially for reviewing diffs. Consider using fetch-depth: 0 to fetch the full git history, or at minimum a deeper history that includes the PR's base branch.
| fetch-depth: 1 | |
| fetch-depth: 0 |
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 |
There was a problem hiding this comment.
Setting fetch-depth: 1 limits Claude's ability to review the full context of changes in the PR. For code reviews, Claude needs access to the base branch and PR branch history to properly understand diffs. Consider using fetch-depth: 0 or removing this parameter to use the default behavior that fetches sufficient history for PR reviews.
| fetch-depth: 1 | |
| fetch-depth: 0 |
|
|
||
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | ||
| # or https://code.claude.com/docs/en/cli-reference for available options | ||
| claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' |
There was a problem hiding this comment.
The allowed tools list restricts Claude to read-only GitHub CLI operations, but the prompt instructs Claude to use gh pr comment to post review feedback. The pattern Bash(gh pr comment:*) only allows reading comment content. To enable posting comments, update to Bash(gh pr comment *) (without the colon) to allow the full comment command including write operations.
| claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' | |
| claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment *),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@differentmatt I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: differentmatt <2965172+differentmatt@users.noreply.github.com>
🤖 Installing Claude Code GitHub App
This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
What is Claude Code?
Claude Code is an AI coding agent that can help with:
How it works
Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
Important Notes
Security
There's more information in the Claude Code action repo.
After merging this PR, let's try mentioning @claude in a comment on any PR to get started!