Skip to content

Add Claude Code GitHub Workflow#479

Merged
cos merged 2 commits intomainfrom
add-claude-github-actions-1770057581784
Feb 2, 2026
Merged

Add Claude Code GitHub Workflow#479
cos merged 2 commits intomainfrom
add-claude-github-actions-1770057581784

Conversation

@cos
Copy link
Copy Markdown
Contributor

@cos cos commented Feb 2, 2026

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


Note

Medium Risk
Adds third-party GitHub Actions that run on PR events and on @claude mentions, introducing new automation and dependency on external action/plugin execution (and related secret/permissions configuration). Main risk is unintended workflow triggers or over-broad permissions rather than code changes.

Overview
Adds two new GitHub Actions workflows to integrate Anthropic Claude Code.

claude.yml runs the anthropics/claude-code-action@v1 when an issue/PR comment or review contains @claude, with read permissions (including actions: read) and an OAuth token secret.

claude-code-review.yml runs an automated PR review job on PR open/sync/reopen events using the Claude Code Review plugin (code-review@claude-code-plugins) and a fixed /code-review:code-review prompt.

Written by Cursor Bugbot for commit 64f8f4e. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings February 2, 2026 18:40
@cos cos merged commit 1997f05 into main Feb 2, 2026
1 check passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds GitHub Actions workflows to enable Claude Code integration in the repository. Claude Code is an AI coding agent that can assist with bug fixes, documentation, feature implementation, code reviews, and testing through @claude mentions in PR and issue comments.

Changes:

  • Added two GitHub Actions workflows for Claude Code integration
  • Configured automatic workflow triggers based on PR/issue comments and events
  • Set up necessary permissions and security configurations for Claude Code access

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/claude.yml Defines workflow to trigger Claude Code when @claude is mentioned in comments or issue/PR bodies
.github/workflows/claude-code-review.yml Sets up automated Claude Code reviews for PRs when opened, synchronized, or reopened

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The workflow requires 'contents: read' permission but Claude Code may need to create branches and commits as mentioned in the PR description. Consider adding 'contents: write' permission to allow Claude to perform file modifications.

Suggested change
contents: read
contents: write

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The workflow has 'pull-requests: read' but Claude needs to create comments and potentially modify PRs as described in the PR description. Consider changing this to 'pull-requests: write' to enable full Claude functionality.

Suggested change
pull-requests: read
pull-requests: write

Copilot uses AI. Check for mistakes.
permissions:
contents: read
pull-requests: read
issues: read
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The workflow has 'issues: read' but Claude needs to comment on issues as mentioned in the PR description. Consider changing this to 'issues: write' to allow Claude to respond to issues.

Suggested change
issues: read
issues: write

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

contents: read
pull-requests: read
issues: read
id-token: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Workflow permissions too restrictive for write operations

Medium Severity

The workflow permissions specify contents: read, pull-requests: read, and issues: read, but the PR description states Claude can "create comments, branches, and commits." These write operations require contents: write, pull-requests: write, and issues: write permissions respectively. Unless the claude-code-action uses a separate GitHub App for authentication, these restrictive permissions will prevent Claude from posting review comments or creating branches/commits.

Additional Locations (1)

Fix in Cursor Fix in Web

(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')))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Workflow triggers duplicate runs on issue assignment

Low Severity

The issues trigger includes both opened and assigned event types, but the if condition only checks if @claude exists in the issue body or title. When an issue containing @claude is created, Claude runs. Later, when that same issue is assigned to someone, the workflow triggers again because the body still contains @claude. This causes duplicate Claude responses for the same mention and wastes API credits.

Fix in Cursor Fix in Web

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.

2 participants