Skip to content

Add Claude Code GitHub Action#81

Merged
don-petry merged 5 commits into
mainfrom
add-claude-code-action
Mar 27, 2026
Merged

Add Claude Code GitHub Action#81
don-petry merged 5 commits into
mainfrom
add-claude-code-action

Conversation

@don-petry

@don-petry don-petry commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Claude Code GitHub Action workflow for automated PR reviews
  • Triggers on PR open/sync and when @claude is mentioned in comments
  • Requires ANTHROPIC_API_KEY secret to be configured in repo settings

Setup Required

  1. Add ANTHROPIC_API_KEY as a repository secret (Settings → Secrets and variables → Actions)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added an automated workflow to process pull requests and to trigger actions when maintainers comment with a mention, enabling automated code-assist and review-related tasks for PRs and comments.

Copilot AI review requested due to automatic review settings March 27, 2026 03:32
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 68419fc0-1f89-4635-9c54-9372b34795cc

📥 Commits

Reviewing files that changed from the base of the PR and between 4b918c4 and c8314ea.

📒 Files selected for processing (1)
  • .github/workflows/claude.yml
📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow that triggers on pull request events and specific comment events, running the Claude Code action on an Ubuntu runner with repository read and PR/issue write permissions and using an Anthropic API key.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/claude.yml
New workflow Claude Code added. Triggers: pull_request (opened, reopened, synchronize), issue_comment and pull_request_review_comment (when body contains @claude and commenter association is OWNER/MEMBER/COLLABORATOR). Runs anthropics/claude-code-action@v1 on ubuntu-latest with secrets.ANTHROPIC_API_KEY; sets repo contents read and PR/issue write permissions; 60-minute timeout.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant GitHub as GitHub (Events)
    participant Runner as Actions Runner (ubuntu-latest)
    participant ClaudeAction as Claude Code Action
    participant Anthropic as Anthropic API

    GitHub->>Runner: trigger workflow (PR event or comment with `@claude`)
    Runner->>ClaudeAction: start action with ANTHROPIC_API_KEY
    ClaudeAction->>Anthropic: send request (analysis / code)
    Anthropic-->>ClaudeAction: response (results)
    ClaudeAction->>GitHub: post/write PR or issue comment (requires write permission)
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 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 'Add Claude Code GitHub Action' accurately and clearly summarizes the main change: adding a new GitHub Actions workflow file for Claude Code 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
  • Commit unit tests in branch add-claude-code-action

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

@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.yml:
- Around line 6-7: Restrict the workflow trigger to PR comments only by updating
the issue_comment trigger: add a conditional check that ensures
github.event.issue.pull_request exists (so only PR issue comments proceed) and
also add a separate pull_request_review_comment trigger to catch PR review
comments; modify the issue_comment entry (symbol: issue_comment) to include the
conditional and add pull_request_review_comment to the triggers so the workflow
no longer runs for regular issue comments.
- Line 21: Replace the floating tag reference "anthropics/claude-code-action@v1"
with an immutable commit SHA for that action (e.g.,
"anthropics/claude-code-action@<commit-sha>") and add a trailing comment like "#
v1.0.79" to indicate which release the SHA corresponds to; update the workflow
line that currently contains uses: anthropics/claude-code-action@v1 to use the
exact SHA instead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e35eb6c5-ee5c-4e83-aa89-1910db711502

📥 Commits

Reviewing files that changed from the base of the PR and between 88cc890 and 39652a1.

📒 Files selected for processing (1)
  • .github/workflows/claude.yml

Comment thread .github/workflows/claude.yml
Comment thread .github/workflows/claude.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitHub Actions workflow to run the Claude Code Action for automated PR review activity in this repository.

Changes:

  • Introduces .github/workflows/claude.yml to run anthropics/claude-code-action@v1 on PR open/reopen/sync.
  • Adds an issue_comment trigger to run when @claude is mentioned in a comment.
  • Uses repository secret ANTHROPIC_API_KEY for authentication to Anthropic.

Comment thread .github/workflows/claude.yml Outdated
Comment thread .github/workflows/claude.yml Outdated
Comment thread .github/workflows/claude.yml
DJ and others added 4 commits March 27, 2026 06:04
- Restrict issue_comment trigger to PR comments only
- Add author-association check (OWNER/MEMBER/COLLABORATOR)
- Add pull_request_review_comment trigger
- Add timeout-minutes to prevent runaway jobs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Pin claude-code-action to commit SHA for supply-chain safety
- Add fork PR guard (secrets unavailable for fork PRs)
- Scope pull_request trigger to main branch
- Use >- folded scalar for if expression

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@don-petry don-petry merged commit 0277dd6 into main Mar 27, 2026
18 checks passed
@don-petry don-petry deleted the add-claude-code-action branch March 27, 2026 13:37
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.

2 participants