Skip to content

Add Claude Code GitHub Workflow #31

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikhailshilkov
Copy link
Member

🤖 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 documentation.

After merging this PR, let's try mentioning @claude in a comment on any PR to get started!

Copy link

claude bot commented Jun 20, 2025

Claude finished @mikhailshilkov's task —— View job


PR Review: Claude Code GitHub Actions Workflows

I've reviewed both workflow files and they look generally well-structured. Here's my detailed feedback:

🟢 Strengths

Security & Permissions

  • Proper secret handling: Uses ${{ secrets.ANTHROPIC_API_KEY }} correctly
  • Minimal permissions: Both workflows use appropriate permission scopes (contents: read, pull-requests: read, issues: read, id-token: write)
  • Secure checkout: Using actions/checkout@v4 with fetch-depth: 1 minimizes attack surface

Configuration & Best Practices

  • Good documentation: Extensive inline comments showing optional configurations
  • Appropriate triggers: Logical event triggers for each workflow purpose
  • Flexible customization: Well-commented examples for different use cases

🟡 Areas for Improvement

Version Management

  • Action version concern (.github/workflows/claude-code-review.yml:36, .github/workflows/claude.yml:34): Using @beta for anthropics/claude-code-action could introduce instability
    uses: anthropics/claude-code-action@beta  # Consider pinning to specific version
    Recommendation: Pin to a specific version once stable releases are available

Workflow Execution

  • No timeout limits: Consider adding timeout-minutes to prevent runaway jobs

    jobs:
      claude-review:
        timeout-minutes: 15  # Suggested addition
        runs-on: ubuntu-latest
  • Potential concurrent execution: Both workflows could run simultaneously on PR events, potentially causing conflicts or redundant comments

Conditional Logic

  • Complex conditions (.github/workflows/claude.yml:15-19): The multi-line conditional could be simplified or broken down for better readability

🟢 Security Assessment

  • Low risk: No security vulnerabilities identified
  • Good practices: Proper secret management and minimal permissions
  • Safe defaults: Reasonable trigger conditions that require user interaction

🟢 Performance Considerations

  • Efficient checkout: fetch-depth: 1 reduces clone time and bandwidth
  • Appropriate triggers: Events are well-targeted to avoid unnecessary runs
  • No performance concerns identified

🔶 Missing Test Coverage

  • No workflow testing: Consider adding test cases or examples to validate workflow functionality
  • No integration tests: The workflows themselves cannot be easily tested without live API keys

📋 Minor Suggestions

  1. Consider workflow naming consistency:

    • claude-code-review.yml vs claude.yml - consider claude-interactive.yml for clarity
  2. Add workflow descriptions:

    name: Claude Code Review
    description: "Automated PR reviews using Claude AI"  # Add this
  3. Consider rate limiting documentation: Add comments about API rate limits and costs

✅ Overall Assessment

These workflows are well-implemented and follow GitHub Actions best practices. The main concern is using the @beta action version, but this is acceptable for initial adoption. The workflows provide good flexibility through extensive configuration options.

Recommendation: ✅ Approve with minor suggestions - This is a solid implementation that will enable Claude Code integration effectively.


Review Tasks

  • Read and analyze .github/workflows/claude-code-review.yml
  • Read and analyze .github/workflows/claude.yml
  • Check for security issues and best practices
  • Evaluate workflow structure and configuration
  • Provide comprehensive review feedback

# assignee_trigger: "claude-bot"

# Optional: Allow Claude to run specific commands
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to enable this? This will make Claude much more effective. (See permission discussion in another thread)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants