Skip to content

Add Claude Code GitHub Workflow#27

Merged
leogdion merged 2 commits into
mainfrom
add-claude-github-actions-1760122747434
Oct 10, 2025
Merged

Add Claude Code GitHub Workflow#27
leogdion merged 2 commits into
mainfrom
add-claude-github-actions-1760122747434

Conversation

@leogdion

@leogdion leogdion commented Oct 10, 2025

Copy link
Copy Markdown
Member

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


Perform an AI-assisted review on CodePeer.com

Summary by CodeRabbit

  • New Features

    • Automated AI code reviews now run on pull requests, providing feedback on code quality, potential bugs, performance, security, and test coverage.
    • You can mention @claude in PR comments, review comments, or issues to request on-demand assistance.
  • Chores

    • Added GitHub Actions workflows to enable AI reviews on PR events and respond to @claude mentions.
    • Configured necessary permissions and tokens for secure operation.

@leogdion leogdion merged commit 02f6d92 into main Oct 10, 2025
3 of 14 checks passed
@leogdion leogdion deleted the add-claude-github-actions-1760122747434 branch October 10, 2025 18:59
@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Adds two GitHub Actions workflows: one runs automated code reviews on pull_request events; the other triggers on comments/reviews/issues when "@claude" is detected. Both check out the repo and invoke a code-review action with OAuth token and scoped permissions to post feedback as PR comments.

Changes

Cohort / File(s) Summary of Changes
Automated PR code review workflow
.github/workflows/claude-code-review.yml
New workflow "Claude Code Review" triggered on pull_request (opened, synchronize); checks out repo; runs claude code action with OAuth token, structured prompt, claude_args, and permissions to comment on PRs.
On-demand Claude via mentions workflow
.github/workflows/claude.yml
New workflow triggered on issue_comment, pull_request_review_comment, issues, pull_request_review; guarded to run when content includes "@claude"; checks out repo; runs claude code action with OAuth token; optional commented configuration for prompt and claude_args; sets additional read permissions.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Developer
  participant GitHub as GitHub (PR Events)
  participant Workflow as Workflow: claude-code-review.yml
  participant Runner as GitHub Runner
  participant Action as Claude Code Action
  participant PR as Pull Request

  Developer->>GitHub: Open/Synchronize PR
  GitHub-->>Workflow: trigger (pull_request)
  Workflow->>Runner: start job
  Runner->>Runner: actions/checkout@v4
  Runner->>Action: run with OAuth token, prompt, claude_args
  Action->>PR: Post review comment
  PR-->>Developer: Feedback visible
Loading
sequenceDiagram
  autonumber
  actor User
  participant GitHub as GitHub (Comments/Reviews/Issues)
  participant Workflow as Workflow: claude.yml
  participant Runner as GitHub Runner
  participant Action as Claude Code Action
  participant Thread as Issue/PR Thread

  User->>GitHub: Add comment/review/issue
  GitHub-->>Workflow: trigger (multiple events)
  alt Contains "@claude"
    Workflow->>Runner: start job
    Runner->>Runner: actions/checkout@v4
    Runner->>Action: run with OAuth token (additional permissions)
    Action->>Thread: Post response/comment
  else No mention
    Workflow-->>GitHub: skip (guard condition)
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paw at CI’s new tune,
Two workflows hop beneath the moon—
One auto-scouts each PR’s code,
One comes when “@claude” is bestowed.
Carrots queued, reviews in sight,
Ship with speed, and bytes done right. 🥕✨

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-claude-github-actions-1760122747434

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e1082d and ad19d92.

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

leogdion added a commit that referenced this pull request Oct 10, 2025
* "Claude PR Assistant workflow"

* "Claude Code Review workflow"
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