Skip to content

Add Claude Code GitHub Workflow#4

Merged
IvanMurzak merged 2 commits intomainfrom
add-claude-github-actions-1772166391311
Feb 27, 2026
Merged

Add Claude Code GitHub Workflow#4
IvanMurzak merged 2 commits intomainfrom
add-claude-github-actions-1772166391311

Conversation

@IvanMurzak
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!

Copilot AI review requested due to automatic review settings February 27, 2026 04:27
Added .NET setup step and updated allowed tools for Claude.
@IvanMurzak IvanMurzak self-assigned this Feb 27, 2026
@IvanMurzak IvanMurzak added the enhancement New feature or request label Feb 27, 2026
@IvanMurzak IvanMurzak merged commit e2fcf00 into main Feb 27, 2026
18 checks passed
@IvanMurzak IvanMurzak deleted the add-claude-github-actions-1772166391311 branch February 27, 2026 04:30
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 adds a GitHub Actions workflow that integrates Claude Code, an AI coding assistant, into the repository. The workflow allows team members to interact with Claude by mentioning @claude in pull request or issue comments, enabling AI-assisted code reviews, bug fixes, documentation updates, and feature implementation.

Changes:

  • New GitHub Actions workflow file that triggers when @claude is mentioned in issues or PR comments
  • Workflow configuration with appropriate permissions and Claude Code action setup
  • Support for multiple trigger types (issue comments, PR review comments, issue creation/assignment, PR reviews)

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

Comment on lines +28 to +34
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The .NET setup is not needed for this Unity project. The existing workflows in this repository (release.yml, test_unity_plugin.yml) use Unity-specific actions like game-ci/unity-test-runner and game-ci/unity-builder, not .NET tooling. Unity has its own runtime and doesn't require the .NET SDK to be installed separately. This setup step should be removed.

Suggested change
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +24
contents: read
pull-requests: read
issues: read
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The permissions listed only include read permissions for contents, pull-requests, issues, and actions. However, according to the PR description, Claude should be able to create comments, branches, and commits. The workflow needs write permissions for: contents (to create branches and commits), pull-requests (to create comments on PRs), and issues (to create comments on issues). Without these permissions, Claude will not be able to perform its intended functions.

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

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

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The fetch-depth is set to 1, which performs a shallow clone. This could limit Claude's ability to understand the full context and history of the repository when analyzing code. Consider using a larger fetch-depth or fetch-depth: 0 (full history) to give Claude better context, similar to how the release.yml workflow uses fetch-depth: 0.

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

Copilot uses AI. Check for mistakes.
9.0.x

- name: Checkout repository
uses: actions/checkout@v4
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

This workflow uses actions/checkout@v4 while other workflows in the repository (release.yml, test_unity_plugin.yml) use actions/checkout@v6. For consistency with the rest of the codebase, this should be updated to v6.

Suggested change
uses: actions/checkout@v4
uses: actions/checkout@v6

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +19
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The workflow is triggered on issue_comment and pull_request_review_comment events without checking the actor's permissions. According to the PR description, only users with write access should be able to trigger Claude. Consider adding a permission check at the beginning of the job to ensure the comment author has write or admin access to the repository. This can be done using github.event.comment.author_association or by checking repository permissions explicitly.

Suggested change
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '@claude') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')) ||
(github.event_name == 'pull_request_review_comment' &&
contains(github.event.comment.body, '@claude') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')) ||
(github.event_name == 'pull_request_review' &&
contains(github.event.review.body, '@claude') &&
(github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER' ||
github.event.review.author_association == 'COLLABORATOR')) ||
(github.event_name == 'issues' &&
(contains(github.event.issue.body, '@claude') ||
contains(github.event.issue.title, '@claude')) &&
(github.event.issue.author_association == 'OWNER' ||
github.event.issue.author_association == 'MEMBER' ||
github.event.issue.author_association == 'COLLABORATOR'))

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants