Skip to content

Add Claude Code GitHub Workflow - #5

Merged
d-ulker merged 2 commits into
mainfrom
add-claude-github-actions-1757793428748
Sep 13, 2025
Merged

Add Claude Code GitHub Workflow#5
d-ulker merged 2 commits into
mainfrom
add-claude-github-actions-1757793428748

Conversation

@d-ulker

@d-ulker d-ulker commented Sep 13, 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

    • Automated AI code reviews on pull requests, providing feedback on code quality, bugs, performance, security, and tests.
    • On-demand AI assistance by mentioning “@claude” in issue/PR comments or reviews.
  • Chores

    • Added GitHub Actions workflows to enable AI-driven reviews and mention-triggered assistance across issues, PRs, and review comments.

@d-ulker d-ulker self-assigned this Sep 13, 2025

@sourcery-ai sourcery-ai 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.

Hi @uelkerd! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Sep 13, 2025

Copy link
Copy Markdown

Walkthrough

Adds two GitHub Actions workflows: one auto-runs Claude-based code review on pull_request events; the other listens for “@claude” mentions on issues and reviews to run Claude Code. Both use anthropics/claude-code-action@v1, require CLAUDE_CODE_OAUTH_TOKEN, and operate with scoped read permissions and id-token write.

Changes

Cohort / File(s) Change Summary
GitHub Actions: PR auto-review
.github/workflows/claude-code-review.yml
Introduces “Claude Code Review” workflow triggered on pull_request (opened, synchronize). Checks out repo, runs anthropics/claude-code-action@v1 with a review prompt, constrained claude_args for gh operations, posts feedback as a PR comment. Permissions: contents/pull-requests/issues read; id-token write.
GitHub Actions: Mention-triggered assistant
.github/workflows/claude.yml
Adds “Claude Code” workflow triggered on issue_comment, pull_request_review_comment, issues, pull_request_review. Conditional run only when “@claude” appears in relevant fields. Checks out repo and runs anthropics/claude-code-action@v1 with actions:read additional permission. Optional prompt/args commented.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant GH as GitHub
    participant R as Actions Runner
    participant CA as Claude Code Action
    participant CLI as gh CLI
    participant PR as Pull Request

    Dev->>GH: Open/Synchronize PR
    GH-->>R: Trigger workflow (claude-code-review)
    R->>R: Checkout (fetch-depth: 1)
    R->>CA: Run anthropics/claude-code-action@v1<br/>with CLAUDE_CODE_OAUTH_TOKEN
    CA-->>R: Analysis output (review notes)
    R->>CLI: gh pr comment --body "<review>"
    CLI-->>PR: Post review comment
    note over R,CA: Permissions: contents/pull-requests/issues: read<br/>id-token: write
Loading
sequenceDiagram
    autonumber
    actor User as User
    participant GH as GitHub
    participant R as Actions Runner
    participant CA as Claude Code Action
    participant CLI as gh CLI
    participant TI as Issue/PR Thread

    User->>GH: Add comment/review/issue
    GH-->>R: Trigger workflow (claude)
    R->>R: if body/title contains "@claude"
    alt contains "@claude"
        R->>R: Checkout (fetch-depth: 1)
        R->>CA: Run anthropics/claude-code-action@v1<br/>with actions: read
        CA-->>R: Response content
        R->>CLI: gh ... comment --body "<response>"
        CLI-->>TI: Post reply
    else no mention
        R-->>GH: Skip job
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws at midnight’s cue,
Two workflows hop where none once grew—
One scans PRs with careful stare,
One answers pings of “@claude” flair.
With tokens tucked and actions light,
We comment, nibble, ship it right. 🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 6ec320a and db1892d.

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

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@d-ulker
d-ulker merged commit 75c7b28 into main Sep 13, 2025
3 checks passed
@d-ulker
d-ulker deleted the add-claude-github-actions-1757793428748 branch September 13, 2025 20:02
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