Skip to content

Add Claude Code GitHub Workflow#115

Merged
jaspermayone merged 3 commits into
mainfrom
add-claude-github-actions-1753026187750
Jul 20, 2025
Merged

Add Claude Code GitHub Workflow#115
jaspermayone merged 3 commits into
mainfrom
add-claude-github-actions-1753026187750

Conversation

@jaspermayone
Copy link
Copy Markdown
Member

@jaspermayone jaspermayone commented Jul 20, 2025

🤖 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
    • Updated workflow authentication method for Claude integration, switching to OAuth token.
    • Added new configuration options to improve comment handling and permissions in code review workflows.
    • Enhanced workflow permissions to allow access to GitHub Actions data for improved CI integration.

Copilot AI review requested due to automatic review settings July 20, 2025 15:43
@jaspermayone jaspermayone requested a review from a team as a code owner July 20, 2025 15:43
@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
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update modifies two GitHub Actions workflow files to change the authentication input parameter from anthropic_api_key to claude_code_oauth_token, adds new optional inputs (use_sticky_comment and additional_permissions), and adjusts permissions to enable Claude to access GitHub Actions data. No application logic or exported entities were changed.

Changes

Files Change Summary
.github/workflows/claude-code-review.yml, .github/workflows/claude.yml Changed input parameter from anthropic_api_key to claude_code_oauth_token; added optional inputs (use_sticky_comment, additional_permissions); updated permissions for Claude job to include actions: read.

Possibly related PRs

  • Claude PR Assistant workflow #109: Introduced the initial Claude workflows that are directly modified in this PR by renaming input parameters and adding optional inputs.

Poem

A rabbit hopped through workflow land,
Swapping keys with gentle hand.
Permissions granted, comments stick,
OAuth tokens do the trick!
Claude now reads with greater might,
All thanks to changes made just right.
🐇✨


📜 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 1b9e520 and 265355b.

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jul 20, 2025

Claude finished @jaspermayone's task —— View job


PR Review Complete ✅

Review Checklist:

  • Read and analyze .github/workflows/claude-code-review.yml
  • Read and analyze .github/workflows/claude.yml
  • Assess code quality and best practices
  • Check for potential bugs or configuration issues
  • Evaluate security considerations
  • Review performance implications
  • Provide constructive feedback and recommendations

Review Feedback

Overall Assessment

This PR adds well-structured GitHub Actions workflows for Claude Code integration. The configuration follows GitHub Actions best practices and includes good documentation through comments.

🔍 Code Quality & Best Practices

Strengths:

  • Clean, well-commented YAML structure
  • Proper use of GitHub Actions syntax and conventions
  • Good separation of concerns between the two workflows
  • Comprehensive configuration options with helpful inline documentation
  • Uses official GitHub actions (actions/checkout@v4)

Areas for Improvement:

  • Redundant Permission Configuration (.github/workflows/claude.yml:40-41): The additional_permissions field duplicates the actions: read permission already defined at the job level (line 26). This redundancy could cause confusion and potential conflicts.

🐛 Potential Issues

  1. Permission Duplication: In claude.yml, the actions: read permission is defined both at the job level (line 26) and in additional_permissions (lines 40-41). This follows the same issue identified by Copilot's review.

  2. Fetch Depth: Both workflows use fetch-depth: 1, which is appropriate for these use cases and improves performance.

🔒 Security Considerations

Positive Security Aspects:

  • Uses OAuth token authentication (CLAUDE_CODE_OAUTH_TOKEN) instead of API keys, which is more secure
  • Proper permission scoping with minimal required permissions
  • Secret references follow GitHub best practices
  • No hardcoded sensitive information

Security Recommendations:

  • The workflows correctly use id-token: write for OIDC, which is a security best practice
  • Permission model follows principle of least privilege

Performance Considerations

Optimizations:

  • fetch-depth: 1 minimizes checkout time and storage
  • Conditional execution in claude.yml prevents unnecessary runs
  • Uses ubuntu-latest which is efficient and well-maintained

🧪 Test Coverage

Observations:

  • No explicit test workflows for the Claude integration itself (which is expected for workflow configurations)
  • The workflows include commented examples for allowed_tools that could enable running project tests

🛠️ Specific Recommendations

  1. Fix Permission Duplication (claude.yml:40-41):

    # Remove this section since actions: read is already at job level
    # additional_permissions: |
    #   actions: read
  2. Consider Adding Project-Specific Tools (both files):

    • Uncomment and configure allowed_tools to enable Claude to run your project's specific commands
    • Example: allowed_tools: "Bash(bun install),Bash(bun run build),Bash(bun run test)"
  3. Optional Enhancements:

    • Consider adding path filters to claude-code-review.yml for relevant file types (currently commented out but could be useful)
    • The custom instructions section could be populated with project-specific coding standards

📋 Summary

This is a solid implementation of Claude Code workflows with one minor configuration issue. The workflows are well-documented, secure, and follow GitHub Actions best practices. The main concern is the redundant permission configuration that should be cleaned up.

Recommendation: Approve after addressing the permission duplication issue.


Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Claude Code GitHub workflows to use OAuth token-based authentication instead of API key authentication and adds permissions for Claude to read CI results on PRs.

Key changes:

  • Switched from anthropic_api_key to claude_code_oauth_token for authentication
  • Added actions: read permission to allow Claude to access CI results
  • Added optional configuration for sticky comments in code review workflow

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/claude.yml Updates authentication method and adds actions read permission with explanatory comments
.github/workflows/claude-code-review.yml Updates authentication method and adds optional sticky comment configuration

Comment on lines +40 to +41
additional_permissions: |
actions: read
Copy link

Copilot AI Jul 20, 2025

Choose a reason for hiding this comment

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

The additional_permissions field appears redundant since actions: read is already defined at the job level (line 26). Consider removing this duplication to avoid confusion and potential conflicts.

Suggested change
additional_permissions: |
actions: read

Copilot uses AI. Check for mistakes.
Signed-off-by: Jasper Mayone <jasper.mayone@phish.directory>
@jaspermayone jaspermayone merged commit 10b7549 into main Jul 20, 2025
5 of 6 checks passed
@jaspermayone jaspermayone deleted the add-claude-github-actions-1753026187750 branch July 20, 2025 15:44
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