Add Claude Code GitHub Workflow#345
Conversation
Greptile SummaryThis PR adds Claude Code automation to GitHub Actions. The main changes are:
Confidence Score: 4/5The workflows need fixes for fork authentication, GitHub write permissions, and pull-request checkout selection before merging.
.github/workflows/claude-code-review.yml and .github/workflows/claude.yml Important Files Changed
Reviews (1): Last reviewed commit: ""Claude Code Review workflow"" | Re-trigger Greptile |
| jobs: | ||
| claude-review: | ||
| # Optional: Filter by PR author |
There was a problem hiding this comment.
Fork Reviews Lack Authentication
A fork pull request reaches this job, but GitHub withholds CLAUDE_CODE_OAUTH_TOKEN from pull_request workflows triggered by forks. Opening, updating, reopening, or marking such a PR ready therefore starts a review that cannot authenticate.
| jobs: | |
| claude-review: | |
| # Optional: Filter by PR author | |
| jobs: | |
| claude-review: | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| # Optional: Filter by PR author |
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
Review Token Cannot Publish Findings
The action falls back to github.token, but this job grants only read access to pull requests and issues. When the review finds a problem, GitHub rejects creation of its review or comment, so the workflow cannot publish its result.
| pull-requests: read | |
| issues: read | |
| pull-requests: write | |
| issues: write |
| contents: read | ||
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
Interactive Replies Are Read-Only
The action uses github.token by default, while this job grants read-only issue and pull-request scopes. A valid @claude request can run Claude but receive a GitHub API authorization error when the action tries to post its reply.
| contents: read | |
| pull-requests: read | |
| issues: read | |
| contents: read | |
| pull-requests: write | |
| issues: write |
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 |
There was a problem hiding this comment.
For issue_comment, pull_request_review_comment, and pull_request_review events, the default checkout ref is the repository's default branch rather than the pull request head. An @claude request about changed code can therefore inspect or modify the wrong revision and return an answer that omits the PR changes.
🤖 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!