Skip to content

Add Claude Code GitHub Workflow#24

Merged
shiqkuangsan merged 4 commits intomainfrom
add-claude-github-actions-1774322926632
Mar 24, 2026
Merged

Add Claude Code GitHub Workflow#24
shiqkuangsan merged 4 commits intomainfrom
add-claude-github-actions-1774322926632

Conversation

@shiqkuangsan
Copy link
Copy Markdown
Owner

@shiqkuangsan shiqkuangsan commented Mar 24, 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!

Summary by CodeRabbit

  • Chores
    • Added an automated code-review workflow that runs on pull request events to provide review feedback.
    • Added an interactive Claude assistant integration that can be invoked from issue and pull-request comments or reviews by mentioning Claude, enabling on-demand review and assistance.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recopy Ready Ready Preview, Comment Mar 24, 2026 5:43am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

📝 Walkthrough

Walkthrough

Two new GitHub Actions workflows are added to enable automated code review functionality using Claude. One workflow performs automatic code reviews on pull requests, while the other responds to code-related comments mentioning @claude in pull requests and issues.

Changes

Cohort / File(s) Summary
Claude Code Review Workflows
.github/workflows/claude-code-review.yml, .github/workflows/claude.yml
Two new GitHub Actions workflows configured to integrate Claude-based code review functionality. The first triggers automatically on PR events to perform code reviews; the second responds to @claude mentions in comments with configurable plugins and OAuth token authentication.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A Claude joins the warren, reviewing code with care,
Comments mention our wise friend, responses in the air,
Pull requests now whisper their secrets to the wise,
Workflows hail the AI muse, oh what a grand surprise! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Claude Code GitHub Workflow' clearly and concisely summarizes the main change: adding GitHub Actions workflows to integrate Claude Code into the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)

✅ Unit Tests committed locally.

  • Create PR with unit tests
  • Commit unit tests in branch add-claude-github-actions-1774322926632

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/claude-code-review.yml:
- Around line 29-32: The workflow uses actions/checkout@v4 with fetch-depth: 1
which limits history and harms multi-commit PR reviews; update the checkout step
to fetch full history (set fetch-depth: 0) or increase the depth to a number
that includes the merge base (e.g., fetch-depth: 50) so Claude can access the
full PR context, keeping the change confined to the checkout action
configuration.
- Around line 22-26: The permissions block currently grants only read access for
contents, pull-requests, and issues which prevents the action from posting
reviews; update the permissions section to set pull-requests: write and also
change contents and issues to write (keep id-token: write) so the workflow can
publish code review comments and follow the official example; modify the
permissions entries named "contents", "pull-requests", and "issues" accordingly.

In @.github/workflows/claude.yml:
- Around line 28-31: The workflow step using actions/checkout@v4 currently sets
fetch-depth: 1 which limits git history; update that checkout step (the
"Checkout repository" job using actions/checkout@v4) to either remove the
fetch-depth option or set fetch-depth to a larger value (e.g., 0 for full
history or a reasonable n) so Claude and CI have adequate commit context for
analyses and PR tasks.
- Around line 21-26: The workflow's permissions block lacks write access for
'issues' and 'pull-requests', preventing anthropics/claude-code-action from
posting responses; update the permissions in the permissions section so that
'issues' and 'pull-requests' are set to write (keep other permissions like
'contents: read', 'id-token: write', and 'actions: read' as needed) so Claude
can create/update comments on PRs and issues.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cbbc7c1d-12cc-40d6-9c2e-b95ecd80408d

📥 Commits

Reviewing files that changed from the base of the PR and between 9d311b3 and 1736c75.

📒 Files selected for processing (2)
  • .github/workflows/claude-code-review.yml
  • .github/workflows/claude.yml

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Note

Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@shiqkuangsan shiqkuangsan merged commit f8a9399 into main Mar 24, 2026
9 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

✅ Unit tests committed locally. Commit: 3ee843f7497d390b1c1f261213ce79b7a1947725

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