Skip to content

Add Claude Code GitHub Workflow#6

Merged
aspectrr merged 2 commits into
mainfrom
add-claude-github-actions-1767652405585
Jan 5, 2026
Merged

Add Claude Code GitHub Workflow#6
aspectrr merged 2 commits into
mainfrom
add-claude-github-actions-1767652405585

Conversation

@aspectrr
Copy link
Copy Markdown
Owner

@aspectrr aspectrr commented Jan 5, 2026

🤖 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!

Copilot AI review requested due to automatic review settings January 5, 2026 22:33
@aspectrr aspectrr merged commit 74ff8b9 into main Jan 5, 2026
6 checks passed
@aspectrr aspectrr deleted the add-claude-github-actions-1767652405585 branch January 5, 2026 22:34
Copy link
Copy Markdown
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, an AI coding agent, into the repository. The integration provides both interactive assistance (via @claude mentions) and automated code reviews on pull requests.

Key changes:

  • Interactive Claude workflow triggered by @claude mentions in comments
  • Automated code review workflow that runs on PR open/sync events
  • Configuration for OAuth authentication using repository secrets

Reviewed changes

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

File Description
.github/workflows/claude.yml Adds interactive Claude workflow triggered by @claude mentions in issues and PR comments
.github/workflows/claude-code-review.yml Adds automated code review workflow that runs on pull request events with custom review prompt

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The workflow has read-only permissions for contents, pull-requests, and issues, but Claude Code likely needs write permissions to create comments, branches, and commits as mentioned in the PR description. Without write permissions, Claude won't be able to perform many of its core functions like responding to comments or making code changes.

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

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The workflow has read-only permissions for contents, pull-requests, and issues, but the code review workflow needs write permissions to post review comments on the PR. The prompt on line 52 explicitly instructs Claude to "use gh pr comment" which requires write access to pull-requests.

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

Copilot uses AI. Check for mistakes.
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The fetch-depth setting is set to 1, which only fetches the latest commit. For a code review workflow that needs to analyze PR diffs and changes, this may be insufficient. Consider using fetch-depth: 0 to fetch the full git history, or at minimum fetch-depth: 2 to include the base commit for comparison.

Suggested change
fetch-depth: 1
fetch-depth: 0

Copilot uses AI. Check for mistakes.

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The documentation comment references 'code.claude.com/docs/en/cli-reference' but the actual URL structure should be verified. The link format appears inconsistent with the other documentation reference on line 54 which uses 'github.com/anthropics/claude-code-action'. Consider verifying this URL is correct or updating it to match the actual documentation location.

Suggested change
# or https://code.claude.com/docs/en/cli-reference for available options
# or https://code.anthropic.com/claude/docs/cli-reference for available options

Copilot uses AI. Check for mistakes.
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.

# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The documentation comment references 'code.claude.com/docs/en/cli-reference' but the actual URL structure should be verified. The link format appears inconsistent with the other documentation reference on line 54 which uses 'github.com/anthropics/claude-code-action'. Consider verifying this URL is correct or updating it to match the actual documentation location.

Suggested change
# or https://code.claude.com/docs/en/cli-reference for available options
# or https://github.com/anthropics/claude-code-action/blob/main/docs/cli-reference.md for available options

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +9
issues:
types: [opened, assigned]
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The workflow triggers on 'issues' events with types 'opened' and 'assigned', which means any user who can create an issue can trigger this workflow. Since there's no restriction on who can trigger this (no write access requirement), this could allow external users to consume API quota or potentially abuse the Claude integration. Consider adding a permission check or removing the 'issues' trigger to limit activation to only pull request contexts where access control is better managed.

Copilot uses AI. Check for mistakes.
aspectrr added a commit that referenced this pull request Jan 11, 2026
* "Claude PR Assistant workflow"

* "Claude Code Review workflow"
@claude claude Bot mentioned this pull request Feb 18, 2026
14 tasks
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