Skip to content

Add Claude Code GitHub Workflow - #9

Merged
koriym merged 2 commits into
masterfrom
add-claude-github-actions-1758354424240
Sep 20, 2025
Merged

koriym merged 2 commits into
masterfrom
add-claude-github-actions-1758354424240

Conversation

@koriym

@koriym koriym commented Sep 20, 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 an automated AI-assisted code review on pull requests, providing feedback on code quality, potential bugs, performance, security, and test coverage.
    • Enabled on-demand AI assistance in issues and pull requests via mention-based triggers, allowing contributors to request help or insights directly within discussions.
    • Configured secure permissions and checkout steps for workflows, with optional filters and customization hooks documented for future tuning.

@coderabbitai

coderabbitai Bot commented Sep 20, 2025 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Adds two GitHub Actions workflows: one for automated code review on pull_request events and another to run on issue/PR events when @claude is mentioned. Both check out the repo and invoke a Claude Code Action with configurable prompts and permissions; optional filters and extra permissions are documented but commented out.

Changes

Cohort / File(s) Change Summary
Automated code review workflow
.github/workflows/claude-code-review.yml
New workflow "Claude Code Review" triggered on pull_request (opened, synchronize). Checks out code and runs a Claude Code Review action with a detailed review prompt; includes commented path/PR filters and tool args.
On-demand Claude action by mention
.github/workflows/claude.yml
New workflow "Claude Code" triggered on various issue/PR/comment events when @claude is mentioned. Checks out code and runs a Claude action; includes optional additional_permissions, custom prompt, and claude_args comments.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub
  participant WF as Workflow: Claude Code Review
  participant Action as Claude Code Action
  participant PR as Pull Request

  Dev->>GH: Open/Synchronize PR
  GH-->>WF: Trigger on pull_request
  WF->>WF: Checkout (fetch-depth: 1)
  WF->>Action: Run review with prompt and claude_args
  Action-->>PR: Post review comment via gh pr comment
Loading
sequenceDiagram
  autonumber
  actor User as User
  participant GH as GitHub
  participant WF as Workflow: Claude Code
  participant Action as Claude Code Action
  participant IssuePR as Issue/PR

  User->>GH: Comment mentioning @claude
  GH-->>WF: Trigger on issue/PR/comment events
  WF->>WF: Checkout (fetch-depth: 1)
  WF->>Action: Execute with token (optional custom prompt/args)
  Action-->>IssuePR: Respond with generated output
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Add Claude Code GitHub Workflow #3 — Introduces the same Claude workflows (.github/workflows/claude-code-review.yml and .github/workflows/claude.yml) with similar configurations.

Poem

A nibble of YAML, a hop through the queue,
I twitch my whiskers at mentions of “@claude”, too.
Pull requests open? I bound in to review—
Carrots for comments, a thump when I’m through.
Ears up, tail fluff: workflows anew! 🥕✨

✨ 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-1758354424240

📜 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 7530d31 and 208b58a.

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

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

@koriym
koriym merged commit fd962ff into master Sep 20, 2025
1 of 2 checks passed
@koriym
koriym deleted the add-claude-github-actions-1758354424240 branch September 20, 2025 07:47
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