Repository navigation
Add Claude Code GitHub Workflow - #1
Conversation
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read |
There was a problem hiding this comment.
🔴 Missing pull-requests: write permission prevents Claude from commenting on PRs
The workflow instructs Claude to leave review comments using gh pr comment (line 52) and includes Bash(gh pr comment:*) in the allowed tools (line 56), but the workflow only has pull-requests: read permission (line 24).
Click to expand
How the bug is triggered
- A pull request is opened or synchronized
- The workflow runs and Claude performs the code review
- Claude attempts to execute
gh pr commentto post the review - The GitHub API rejects the request because the workflow token only has read permission on pull requests
Actual vs Expected
Actual: The gh pr comment command fails with a permission error, and the review is never posted to the PR.
Expected: Claude successfully posts the code review as a comment on the PR.
Impact
The workflow's primary purpose (posting code reviews as PR comments) will fail every time. The code review analysis may complete successfully, but the results will never be visible to users.
Fix
Change line 24 from:
pull-requests: readto:
pull-requests: writeWas this helpful? React with 👍 or 👎 to provide feedback.
🤖 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!