Skip to content

Add Claude Code GitHub Workflow#1

Closed
fearandesire wants to merge 1 commit into
mainfrom
add-claude-github-actions-1782514951020
Closed

Add Claude Code GitHub Workflow#1
fearandesire wants to merge 1 commit into
mainfrom
add-claude-github-actions-1782514951020

Conversation

@fearandesire

Copy link
Copy Markdown
Owner

🤖 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:

  • Bug fixes and improvements
  • Documentation updates
  • Implementing new features
  • Code reviews and suggestions
  • Writing tests
  • And more!

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

  • This workflow won't take effect until this PR is merged
  • @claude mentions won't work until after the merge is complete
  • The workflow runs automatically whenever Claude is mentioned in PR or issue comments
  • Claude gets access to the entire PR or issue context including files, diffs, and previous comments

Security

  • Our Anthropic API key is securely stored as a GitHub Actions secret
  • Only users with write access to the repository can trigger the workflow
  • All Claude runs are stored in the GitHub Actions run history
  • Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
  • We can add more allowed tools by adding them to the workflow file like:
allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)

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!

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a Claude Code GitHub Actions workflow. The main changes are:

  • Triggers Claude on @claude mentions in issue comments, PR review comments, reviews, and issue text.
  • Checks out the repository and runs anthropics/claude-code-action@v1.
  • Passes the Claude OAuth secret and grants read access to repository, issue, PR, action, and OIDC context.

Confidence Score: 4/5

The workflow is straightforward but needs its token permissions aligned with the documented Claude capabilities before merge.

Only one workflow file changed, and the issue is localized to the permissions block that controls whether Claude can perform write actions.

.github/workflows/claude.yml

T-Rex T-Rex Logs

What T-Rex did

  • Reproduced a focused permission-contract verifier against the repository's actual .github/workflows/claude.yml and confirmed the permissions block declares read for comments, pull requests, and issues, with write operations failing in the verifier.
  • Observed that the base state had no Claude workflow configured, and after changes a parsed workflow configuration with an evaluation matrix shows which events are supported (and run) and which edits are not invoked.

View all artifacts

T-Rex Ran code and verified through T-Rex

Fix All in Claude Code Fix All in Cursor Cloud Agents

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
.github/workflows/claude.yml:21-26
**Grant write permissions**
This workflow gives Claude only read-scoped `GITHUB_TOKEN` permissions, so the action can read context but cannot perform the documented tasks in the PR description such as creating comments, branches, or commits. Anthropic’s GitHub Actions docs list write permissions for repository contents and issues for this setup, so `contents`, `issues`, and likely `pull-requests` need `write` when Claude is expected to act on requests.

Reviews (1): Last reviewed commit: ""Claude PR Assistant workflow"" | Re-trigger Greptile

Comment on lines +21 to +26
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Grant write permissions
This workflow gives Claude only read-scoped GITHUB_TOKEN permissions, so the action can read context but cannot perform the documented tasks in the PR description such as creating comments, branches, or commits. Anthropic’s GitHub Actions docs list write permissions for repository contents and issues for this setup, so contents, issues, and likely pull-requests need write when Claude is expected to act on requests.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/claude.yml
Line: 21-26

Comment:
**Grant write permissions**
This workflow gives Claude only read-scoped `GITHUB_TOKEN` permissions, so the action can read context but cannot perform the documented tasks in the PR description such as creating comments, branches, or commits. Anthropic’s GitHub Actions docs list write permissions for repository contents and issues for this setup, so `contents`, `issues`, and likely `pull-requests` need `write` when Claude is expected to act on requests.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Cursor Cloud Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant