Skip to content

Add Claude Code GitHub Workflow - #20

Merged
nstepien merged 4 commits into
mainfrom
add-claude-github-actions-1772915837105
Mar 7, 2026
Merged

nstepien merged 4 commits into
mainfrom
add-claude-github-actions-1772915837105

Conversation

@nstepien

@nstepien nstepien commented Mar 7, 2026 •

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

    • Added an automated Claude Code Review workflow for pull requests.
    • Added a Claude Code workflow that responds to @claude mentions in comments and reviews.
  • Chores

    • Clarified GitHub Actions step labels (e.g., "Checkout repository") for CI and release workflows.

@nstepien nstepien self-assigned this Mar 7, 2026
@coderabbitai

coderabbitai Bot commented Mar 7, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9f84131-843a-4432-b2d0-32072a03a07d

📥 Commits

Reviewing files that changed from the base of the PR and between 48db70b and 6a5c37c.

📒 Files selected for processing (2)
  • .github/workflows/claude-code-review.yml
  • .github/workflows/claude.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/claude.yml
  • .github/workflows/claude-code-review.yml

📝 Walkthrough

Walkthrough

Added two new GitHub Actions workflows for Claude code review triggers and aligned checkout step labels in existing CI/release workflows; workflows invoke the anthropics/claude-code-action with required secrets and permissions and include mention-based and PR-event activation logic.

Changes

Cohort / File(s) Summary
Checkout Step Consistency
.github/workflows/ci.yml, .github/workflows/release.yml
Renamed workflow step label from "Checkout code" to "Checkout repository" for naming consistency; no functional change to actions/checkout usage.
Claude Code Review Workflows
.github/workflows/claude-code-review.yml, .github/workflows/claude.yml
Added two new workflows. claude-code-review.yml runs on PR events (opened, synchronize, ready_for_review, reopened) and executes anthropics/claude-code-action@v1 with CLAUDE_CODE_OAUTH_TOKEN, plugin and prompt config. claude.yml triggers on issue/pr comments and PR events when @claude is present, sets permissions (including additional read for actions), and runs the same Claude action with required secret and options.

Sequence Diagram(s)

sequenceDiagram
  participant GitHub as GitHub Events
  participant Runner as Actions Runner
  participant Checkout as Checkout Step
  participant ClaudeAction as Claude Action (anthropics/claude-code-action)
  participant ClaudeAPI as Claude Service

  GitHub->>Runner: push / PR / comment event
  Runner->>Checkout: checkout repository
  Runner->>ClaudeAction: run Claude Action (with CLAUDE_CODE_OAUTH_TOKEN, plugins, prompt)
  ClaudeAction->>ClaudeAPI: send repo+PR payload and prompt
  ClaudeAPI-->>ClaudeAction: analysis / review output
  ClaudeAction-->>Runner: post comments / PR updates (using permissions)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With nimble paws I hop through CI trees,

I rename a step and summon two Claudes with ease,
When "@claude" is called I'll fetch the PR light,
I twitch my nose and make sure the reviews are right.

🚥 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 accurately describes the main changes: adding Claude Code GitHub Actions workflows (.claude-code-review.yml, .claude.yml) to enable Claude integration.
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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-claude-github-actions-1772915837105

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

@nstepien
nstepien marked this pull request as ready for review March 7, 2026 20:56

@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

🤖 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 10-14: The workflow currently grants only pull-requests: read
which prevents the action from posting review comments; update the permissions
block in the workflow to change pull-requests from read to write so Claude Code
Review can post comments (i.e., replace or modify the existing pull-requests:
read entry to pull-requests: write in the permissions section).

In @.github/workflows/claude.yml:
- Around line 21-26: Update the GitHub Actions workflow permissions to grant
write access for pull-requests and issues so Claude can post comments and
interact with PRs; specifically change the permissions entries for
"pull-requests" and "issues" from read to write in the permissions block (leave
other permissions like "contents", "id-token", and "actions" as-is).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b7f4a11-41ba-4a32-9216-545b2b1e3363

📥 Commits

Reviewing files that changed from the base of the PR and between 05f8738 and 48db70b.

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

Comment thread .github/workflows/claude.yml Resolved
@nstepien
nstepien merged commit 6c7f15c into main Mar 7, 2026
5 checks passed
@nstepien
nstepien deleted the add-claude-github-actions-1772915837105 branch March 7, 2026 21:17
@coderabbitai coderabbitai Bot mentioned this pull request Mar 9, 2026
3 tasks
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