Skip to content

add claude code workflow - #19

Merged
csamuel merged 5 commits into
mainfrom
add-claude-github-actions-1759685647164
Oct 5, 2025
Merged

add claude code workflow#19
csamuel merged 5 commits into
mainfrom
add-claude-github-actions-1759685647164

Conversation

@csamuel

@csamuel csamuel commented Oct 5, 2025

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!

Summary by CodeRabbit

  • New Features

    • Automatic AI-powered code reviews on pull requests, providing feedback on quality, bugs, performance, security, and test coverage.
    • On-demand assistance: mention “@claude” in issue or PR comments to request contextual AI feedback.
    • Comment-triggered reviews also supported via issue/PR review comments.
  • Chores

    • Added CI workflows to enable the Claude-based review and comment interactions.
    • Removed the previous AI review workflow (replaced by the new Claude flows).

@coderabbitai

coderabbitai Bot commented Oct 5, 2025

Copy link
Copy Markdown

Walkthrough

Adds two Claude-based GitHub Actions workflows (one auto-runs on pull_request, one on "@claude" mentions) and removes an existing Gemini-based PR review workflow file. (49 words)

Changes

Cohort / File(s) Summary of Changes
PR auto-review workflow
.github/workflows/claude-code-review.yml
Added workflow triggered on pull_request events (opened, reopened). Defines job claude-review running anthropics/claude-code-action@v1 with an OAuth token, a multi-line review prompt, and claude_args restricting allowed Bash/gh tools; sets repository permissions.
Mention-driven Claude workflow
.github/workflows/claude.yml
Added workflow triggered on issue_comment, pull_request_review_comment, pull_request_review, and issues, conditioned on payloads containing @claude. Runs anthropics/claude-code-action@v1 using claude_code_oauth_token, passes repository context and triggering body as the request, and grants actions: read via additional_permissions.
Removed Gemini workflow
.github/workflows/gemini-pr-review.yml
Deleted entire workflow that previously implemented a Gemini-based PR review flow (checked out PR, generated tokens, fetched PR details/diffs, invoked Gemini review action with extensive env/settings/prompt, and posted failure comments).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GitHub as GitHub Events
  participant WF_PR as claude-code-review.yml
  participant WF_M as claude.yml
  participant Claude as anthropics/claude-code-action
  participant GHCLI as gh (allowed)
  participant PR as Pull Request / Thread

  rect rgb(240,248,255)
    note over GitHub,WF_PR: PR opened / updated triggers auto-review
    GitHub->>WF_PR: pull_request event
    WF_PR->>Claude: start job with review prompt + claude_args
    Claude->>GHCLI: run allowed `gh` subcommands
    GHCLI->>PR: post review comments
  end

  rect rgb(245,255,245)
    note over GitHub,WF_M: Comment/review/issue contains "@claude"
    GitHub->>WF_M: issue_comment / review / issues event
    WF_M->>WF_M: evaluate "@claude" condition
    WF_M->>Claude: run with forwarded body & repo context
    Claude->>PR: reply in thread or post comment
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

I twitch my whiskers at CI light,
Two Claudes awake to check the night.
I hop on comments, nudge and write,
With tiny paws and tokens tight.
Merge me swift — the branches bright. 🐇✨

Pre-merge checks and finishing touches

✅ 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 workflow” clearly and concisely describes the primary change—adding a Claude Code GitHub Actions workflow to the repository—and aligns with the PR objectives without including unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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-1759685647164

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.

@github-actions

github-actions Bot commented Oct 5, 2025

Copy link
Copy Markdown

There is a problem with the Gemini CLI PR review. Please check the action logs for details.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db3a875 and 1a110e9.

📒 Files selected for processing (2)
  • .github/workflows/claude-code-review.yml (1 hunks)
  • .github/workflows/claude.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: flake-check

Comment thread .github/workflows/claude-code-review.yml
Comment thread .github/workflows/claude.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13f6c3f and 4f44228.

📒 Files selected for processing (2)
  • .github/workflows/claude-code-review.yml (1 hunks)
  • .github/workflows/claude.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/claude-code-review.yml

[warning] 51-51: too many blank lines (1 > 0)

(empty-lines)

.github/workflows/claude.yml

[warning] 65-65: too many blank lines (1 > 0)

(empty-lines)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: lint

Comment thread .github/workflows/claude-code-review.yml
@csamuel
csamuel merged commit ddb6f47 into main Oct 5, 2025
11 checks passed
@csamuel
csamuel deleted the add-claude-github-actions-1759685647164 branch October 5, 2025 18:14
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