Skip to content

Add claude workflow#378

Open
chowbao wants to merge 2 commits intomasterfrom
add-claude-workflow
Open

Add claude workflow#378
chowbao wants to merge 2 commits intomasterfrom
add-claude-workflow

Conversation

@chowbao
Copy link
Contributor

@chowbao chowbao commented Feb 23, 2026

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with the jira ticket associated with the PR.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated the README with the added features, breaking changes, new instructions on how to use the repository. I updated the description of the fuction with the changes that were made.

Release planning

  • I've decided if this PR requires a new major/minor/patch version accordingly to
    semver, and I've changed the name of the BRANCH to major/_ , minor/_ or patch/* .

What

Test adding claude workflow for https://github.com/anthropics/claude-code-action/tree/main

Why

Unsure if this is what is needed for claude tagging for reviews and github issues

Known limitations

[TODO or N/A]

Copilot AI review requested due to automatic review settings February 23, 2026 20:57
@chowbao chowbao requested a review from a team as a code owner February 23, 2026 20:57
Copy link

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 pull request adds a new GitHub Actions workflow to integrate Claude, Anthropic's AI assistant, for automated code reviews and issue responses. The workflow is triggered when users mention @claude in issue comments, PR review comments, or PR reviews, as well as when issues are opened or assigned to the Claude bot. This enables the repository to leverage AI-powered assistance for code-related questions and reviews.

Changes:

  • Added a new GitHub Actions workflow file that triggers on issue and PR comment events
  • Configured the workflow to respond to @claude mentions and Claude bot assignments
  • Set up necessary permissions and OAuth token authentication for the Claude integration

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

(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.assignees.*.login, 'claude[bot]')))
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The condition on line 19 uses 'contains(github.event.issue.assignees..login, 'claude[bot]')' which may not work as intended. The 'github.event.issue.assignees..login' syntax is not valid for filtering arrays in GitHub Actions expressions.

To check if 'claude[bot]' is among the assignees, you would need to use a different approach, such as converting the assignees array to JSON and using the 'contains()' function on the JSON string. However, this is complex and error-prone. Consider removing this check or using a separate step with a script to properly validate assignees if this functionality is needed.

Suggested change
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.assignees.*.login, 'claude[bot]')))
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))

Copilot uses AI. Check for mistakes.
issues: write
id-token: write
steps:
- uses: anthropics/claude-code-action@v1
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

For better security, consider pinning the action to a specific commit SHA rather than using a mutable version tag like @v1. Version tags can be moved to point to different commits, potentially introducing malicious code. This is especially important for third-party actions that have write permissions to the repository.

For example, instead of:

- uses: anthropics/claude-code-action@v1

Use:

- uses: anthropics/claude-code-action@<commit-sha>  # v1

This pattern is already used for the docker/login-action in build.yml:31, which pins to a specific SHA.

Suggested change
- uses: anthropics/claude-code-action@v1
- uses: anthropics/claude-code-action@<commit-sha> # v1

Copilot uses AI. Check for mistakes.
issues: write
id-token: write
steps:
- uses: anthropics/claude-code-action@v1
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The step using the claude-code-action is missing a 'name' attribute. All other workflow steps in the repository include descriptive names for better readability and debugging. Add a name to this step, such as:

- name: Run Claude Code Action
  uses: anthropics/claude-code-action@v1
Suggested change
- uses: anthropics/claude-code-action@v1
- name: Run Claude Code Action
uses: anthropics/claude-code-action@v1

Copilot uses AI. Check for mistakes.
types: [opened, assigned]
pull_request_review:
types: [submitted]

Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

This workflow is missing the concurrency configuration that is present in all other workflows in the repository. All other workflows include a concurrency setting to prevent multiple concurrent runs and manage workflow execution properly. Add the following after the 'on' section:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}
  cancel-in-progress: true

This ensures that for event-driven workflows like this one, only the most recent instance runs, which is important for managing Claude's responses to comments and avoiding confusion from multiple concurrent executions.

Suggested change
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}
cancel-in-progress: true

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants