Skip to content

Add Claude Code GitHub Workflow#9

Merged
abhid1234 merged 2 commits into
mainfrom
add-claude-github-actions-1768699574262
Jan 18, 2026
Merged

Add Claude Code GitHub Workflow#9
abhid1234 merged 2 commits into
mainfrom
add-claude-github-actions-1768699574262

Conversation

@abhid1234

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!

@abhid1234

Copy link
Copy Markdown
Owner Author

@claude-code explain the PR

@abhid1234 abhid1234 merged commit 2c67940 into main Jan 18, 2026
1 check passed
@abhid1234

Copy link
Copy Markdown
Owner Author

@claude-code explain the PR

@abhid1234

Copy link
Copy Markdown
Owner Author

@claude explain the PR

@claude

claude Bot commented Jan 18, 2026

Copy link
Copy Markdown

Claude finished @abhid1234's task in 41s —— View job


PR #9 Explanation

Tasks

  • Read workflow files
  • Analyze workflow configurations
  • Provide comprehensive explanation

Overview

This PR adds two GitHub Actions workflows that enable AI-powered code assistance using Claude Code in your repository. Here's what each workflow does:

1. Main Claude Code Workflow (claude.yml)

Purpose: Allows interactive AI assistance by mentioning @claude in comments

Triggers: Lines 3-11

  • issue_comment: When someone comments on an issue or PR
  • pull_request_review_comment: When someone comments on specific code lines in a PR
  • issues: When issues are opened or assigned
  • pull_request_review: When someone submits a PR review

Activation Condition: Lines 15-19
The workflow only runs when @claude is mentioned in:

  • Issue/PR comments
  • PR review comments
  • PR reviews
  • Issue titles or bodies

Permissions: Lines 21-26

  • contents: read - Read repository files
  • pull-requests: read - Access PR information
  • issues: read - Access issue information
  • id-token: write - Required for authentication
  • actions: read - Read CI results to provide context about build/test failures

Configuration: Lines 33-49

  • Uses anthropics/claude-code-action@v1
  • Requires ANTHROPIC_API_KEY secret
  • Can be customized with optional prompt parameter to override instructions
  • Can add claude_args to configure allowed tools (e.g., --allowed-tools Bash(npm test))

2. Automatic Code Review Workflow (claude-code-review.yml)

Purpose: Automatically reviews PRs using Claude Code's code-review plugin

Triggers: Lines 3-11

  • pull_request events: opened, synchronize (new commits), ready_for_review, reopened
  • Optional path filtering (commented out) to only review specific file types

Activation Condition: Lines 14-19

  • Currently runs on all PRs
  • Can be configured to filter by PR author or contributor type (commented out examples)

Configuration: Lines 34-43

  • Uses the same claude-code-action@v1
  • Loads the code-review plugin from the official plugin marketplace
  • Automatically runs /code-review:code-review command on the PR
  • Provides systematic code review without requiring @claude mention

Key Differences

Feature claude.yml claude-code-review.yml
Trigger Manual (@claude mention) Automatic (PR events)
Purpose General assistance Code review only
Scope Issues, PRs, comments PRs only
Plugin None (general Claude) code-review plugin

Security & Access

  • Both workflows require the ANTHROPIC_API_KEY secret to be configured
  • Only users with write access can trigger workflows via comments
  • All runs are logged in GitHub Actions history
  • The workflows run in isolated GitHub Actions runners
  • By default, Claude cannot run arbitrary bash commands unless explicitly allowed via claude_args

Usage Examples

With claude.yml:

  • Comment @claude explain this function on a PR
  • Comment @claude fix the bug in auth.js on an issue
  • Add @claude in a PR review with specific requests

With claude-code-review.yml:

  • Simply open a PR - Claude automatically reviews it
  • Push new commits - Claude reviews the changes automatically

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