Skip to content

feat: add claude code workflow#459

Merged
ovitrif merged 2 commits intomasterfrom
add-claude-github-actions-1762472011534
Nov 7, 2025
Merged

feat: add claude code workflow#459
ovitrif merged 2 commits intomasterfrom
add-claude-github-actions-1762472011534

Conversation

@ovitrif
Copy link
Collaborator

@ovitrif ovitrif commented Nov 6, 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!

@ovitrif ovitrif requested a review from jvsena42 November 6, 2025 23:34
@ovitrif ovitrif self-assigned this Nov 6, 2025
@ovitrif ovitrif changed the title Add Claude Code GitHub Workflow feat: add claude code workflow Nov 6, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ovitrif ovitrif requested a review from Copilot November 6, 2025 23:36
@ovitrif ovitrif enabled auto-merge November 6, 2025 23:36
Copy link
Contributor

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 adds GitHub Actions workflows to integrate Claude Code AI assistant into the repository for interactive support and automated code reviews.

  • Adds a comment-triggered workflow that responds when users mention @claude in issues and PRs
  • Adds an automated workflow that runs Claude Code Review on all new and updated pull requests
  • Both workflows use the Anthropic Claude Code action with OAuth authentication

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/claude.yml Interactive Claude workflow triggered by @claude mentions in comments, issues, and PR reviews
.github/workflows/claude-code-review.yml Automated Claude Code Review workflow that runs on PR open/synchronize events

Comment on lines +23 to +24
pull-requests: read
issues: read
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Missing write permission for pull-requests and issues. The workflow needs write permissions to post comments on PRs and issues. Currently only read permission is granted, which will cause the action to fail when attempting to post comments.

Suggested change
pull-requests: read
issues: read
pull-requests: write
issues: write

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

interesting, will try without any changes, to see how the default performs

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Missing write permission for pull-requests. The workflow needs write permissions to post review comments on PRs. Currently only read permission is granted, which will prevent Claude from posting the review feedback as specified in the prompt (line 52: "Use gh pr comment").

Suggested change
pull-requests: read
pull-requests: write

Copilot uses AI. Check for mistakes.
permissions:
contents: read
pull-requests: read
issues: read
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The issues: read permission appears unnecessary for this PR review workflow. The workflow is only triggered by pull request events and only interacts with PRs (not issues). Consider removing this permission to follow the principle of least privilege.

Suggested change
issues: read

Copilot uses AI. Check for mistakes.
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The allowed tools in claude_args include gh issue commands (gh issue view:*, gh search:*, gh issue list:*) which are unnecessary for a PR review workflow. This workflow only needs PR-related commands. Consider simplifying to only include PR commands: --allowed-tools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"

Suggested change
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
claude_args: '--allowed-tools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'

Copilot uses AI. Check for mistakes.
@jvsena42
Copy link
Member

jvsena42 commented Nov 7, 2025

there are some unverified commits

@ovitrif ovitrif force-pushed the add-claude-github-actions-1762472011534 branch from 187c0ab to aa4a82c Compare November 7, 2025 11:49
@ovitrif ovitrif force-pushed the add-claude-github-actions-1762472011534 branch from aa4a82c to a5c03d2 Compare November 7, 2025 11:52
@ovitrif ovitrif merged commit e7199d0 into master Nov 7, 2025
3 checks passed
@ovitrif ovitrif deleted the add-claude-github-actions-1762472011534 branch November 7, 2025 11:52
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.

3 participants