Add Claude Code GitHub Workflow#4
Conversation
Added .NET setup step and updated allowed tools for Claude.
There was a problem hiding this comment.
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
@claudeis 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.
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: | | ||
| 8.0.x | ||
| 9.0.x | ||
|
|
There was a problem hiding this comment.
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.
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x |
| contents: read | ||
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
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.
| contents: read | |
| pull-requests: read | |
| issues: read | |
| contents: write | |
| pull-requests: write | |
| issues: write |
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 |
There was a problem hiding this comment.
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.
| fetch-depth: 1 | |
| fetch-depth: 0 |
| 9.0.x | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
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.
| uses: actions/checkout@v4 | |
| uses: actions/checkout@v6 |
| (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'))) |
There was a problem hiding this comment.
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.
| (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')) |
🤖 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:
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
Security
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!