Skip to content

Add Claude Code GitHub Workflow - #3

Merged
koriym merged 2 commits into
proofreadingfrom
add-claude-github-actions-1757652055953
Sep 12, 2025
Merged

koriym merged 2 commits into
proofreadingfrom
add-claude-github-actions-1757652055953

Conversation

@koriym

@koriym koriym commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

🤖 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
    • Introduced automated AI code reviews on pull requests to improve code quality and feedback cadence.
    • Enabled @claude mentions in issues and PR comments to request on-demand AI assistance, with scoped permissions and CI awareness.
    • Added GitHub Actions workflows to run these capabilities on relevant PR and issue events.

@coderabbitai

coderabbitai Bot commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Adds two new GitHub Actions workflows integrating Claude Code: one auto-reviewing pull requests on open/synchronize events, and another responding to comments/issues that mention @claude. Both check out the repo and run anthropics/claude-code-action@v1 with scoped permissions and a secret OAuth token.

Changes

Cohort / File(s) Summary
GitHub Actions: Claude review automation
\.github/workflows/claude-code-review.yml
New workflow "Claude Code Review" triggers on PR opened/synchronize. Runs checkout and anthropics/claude-code-action@v1 with CLAUDE_CODE_OAUTH_TOKEN, scoped permissions, claude_args (allowed gh commands), and a multi-line review prompt. Optional author filter commented out.
GitHub Actions: Claude on demand
\.github/workflows/claude.yml
New workflow "Claude Code" triggers on issue/PR comments and issues/PR reviews when @claude is mentioned. Runs checkout and anthropics/claude-code-action@v1 with CLAUDE_CODE_OAUTH_TOKEN, adds actions: read permission. Includes commented examples for prompt/claude_args and doc links.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant GH as GitHub (PR Events)
  participant GA as GitHub Actions Runner
  participant Act as Claude Code Action
  participant API as GitHub API/CLI

  rect rgba(200,230,255,0.3)
  note over GH: PR opened / synchronize
  GH->>GA: Trigger workflow: "Claude Code Review"
  GA->>GA: actions/checkout@v4 (fetch-depth: 1)
  GA->>Act: Run anthropics/claude-code-action@v1<br/>with CLAUDE_CODE_OAUTH_TOKEN
  Act->>API: gh pr diff/view/list, gh pr comment (scoped)
  API-->>Dev: Review comments posted on PR
  end
Loading
sequenceDiagram
  autonumber
  participant User as User
  participant GH as GitHub (Comments/Issues/Reviews)
  participant GA as GitHub Actions Runner
  participant Act as Claude Code Action
  participant API as GitHub API/CLI

  rect rgba(220,255,220,0.3)
  note over GH: Comment/Issue/Review mentioning @claude
  GH->>GA: Trigger workflow: "Claude Code"
  GA->>GA: actions/checkout@v4 (fetch-depth: 1)
  GA->>Act: Run anthropics/claude-code-action@v1<br/>with CLAUDE_CODE_OAUTH_TOKEN
  Act->>API: Read actions, PR/issue data (scoped)
  API-->>User: Bot response via comments
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my ears at CI’s new tune,
Two workflows hop beneath the moon—
One checks each PR on the fly,
One answers mentions bounding by.
With tokens snug and scopes just right,
I nibble diffs and comment bright.
Thump-thump—reviews take flight!


📜 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 3ba3170 and 9b2ad8b.

📒 Files selected for processing (2)
  • .github/workflows/claude-code-review.yml (1 hunks)
  • .github/workflows/claude.yml (1 hunks)
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-claude-github-actions-1757652055953

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

@koriym
koriym merged commit fcef710 into proofreading Sep 12, 2025
1 of 2 checks passed
@koriym
koriym deleted the add-claude-github-actions-1757652055953 branch September 12, 2025 04:43
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