Skip to content

Enable Claude assignee trigger for GitHub App#36

Draft
BenGWeeks wants to merge 1 commit intomainfrom
enable-claude-assignee-trigger
Draft

Enable Claude assignee trigger for GitHub App#36
BenGWeeks wants to merge 1 commit intomainfrom
enable-claude-assignee-trigger

Conversation

@BenGWeeks
Copy link
Owner

Summary

  • Enable assignee trigger to respond when the @claude GitHub App is assigned to issues
  • Uncomment and configure assignee_trigger: "claude" in the workflow
  • This provides an additional way to activate Claude besides @mentions

Test plan

  • Assign an issue to the @claude GitHub App and verify it triggers the workflow
  • Confirm existing @claude mention triggers continue to work

This complements the existing trigger methods:

  • @claude mentions in comments, titles, descriptions
  • Assignment to the official Claude GitHub App

🤖 Generated with Claude Code

- Uncomment and configure assignee_trigger to respond when @claude app is assigned
- This allows triggering Claude by assigning issues to the official Claude GitHub App
- Works in addition to existing @claude mention triggers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude
Copy link
Contributor

claude bot commented Jun 21, 2025

Claude finished @BenGWeeks's task —— View job


Code Review Complete

Reviewing PR #36: Enable Claude assignee trigger for GitHub App

Todo List:

  • Read the modified workflow file (.github/workflows/claude.yml)
  • Analyze the specific changes made
  • Review for code quality and best practices
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security concerns
  • Review test coverage implications
  • Provide comprehensive feedback

Review Feedback

Code Quality and Best Practices

  • The change is minimal and clean - simply enabling the assignee_trigger parameter
  • YAML syntax is correct and follows the existing file structure
  • Parameter name and value are consistent with the Claude Code Action documentation
  • Good use of descriptive comments explaining the feature

⚠️ Potential Bug Found

Critical Issue: The workflow's job condition (lines 19-25) doesn't include a check for assignee events, which means the assignee trigger won't work as expected.

Current job condition:

if: |
  (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 == 'discussion' && (contains(github.event.discussion.body, '@claude') || contains(github.event.discussion.title, '@claude'))) ||
  (github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@claude'))

Missing condition needed:

(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'claude')

Without this condition, the workflow will trigger on assignment events but the job won't run, making the assignee trigger ineffective.

Performance Considerations

  • Minimal performance impact - only adds one additional trigger method
  • No additional resource usage or job complexity
  • Maintains the same execution pattern as existing triggers

Security Concerns

  • No new security risks introduced
  • Uses the same permissions and action version as existing triggers
  • No exposure of sensitive information or credentials

Test Coverage

  • PR includes a clear test plan with specific test cases
  • Tests cover both the new assignee trigger and existing @mention functionality
  • Good practice to verify backward compatibility

Recommendations

  1. Fix the job condition to include the assignee trigger check (see bug details above)
  2. Test thoroughly - The current implementation won't work without the condition fix
  3. Consider edge cases - What happens if someone other than "claude" is assigned?

Summary

The concept and implementation approach are sound, but there's a critical bug that prevents the assignee trigger from working. The job condition needs to be updated to handle assignment events properly.


@BenGWeeks
Copy link
Owner Author

See review comment @claude about this missing:

(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'claude')

@claude
Copy link
Contributor

claude bot commented Jun 21, 2025

Claude finished @BenGWeeks's task —— View job


Adding Missing Assignee Trigger Condition

Todo List:

  • Read the current workflow file (.github/workflows/claude.yml)
  • Locate the job condition that needs the missing assignee trigger check
  • Add the missing condition: (github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'claude')
  • Attempt to commit the fix to the PR branch
  • Identify GitHub App permission limitation

⚠️ Permission Limitation Encountered

I successfully identified and prepared the fix for the missing assignee trigger condition, but I'm unable to commit changes to workflow files due to GitHub App security restrictions. The GitHub App doesn't have permissions to modify files in the .github/workflows/ directory.

The Required Fix

The missing condition has been identified and prepared. Here's what needs to be added to .github/workflows/claude.yml on line 24 (after the existing issues condition):

(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'claude') ||

Complete Fixed Job Condition

The full job condition should look like this (lines 19-26):

if: |
  (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 == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'claude') ||
  (github.event_name == 'discussion' && (contains(github.event.discussion.body, '@claude') || contains(github.event.discussion.title, '@claude'))) ||
  (github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@claude'))

Next Steps

You'll need to manually add this condition to make the assignee trigger functional. Once added, the workflow will properly trigger when the 'claude' user is assigned to an issue, completing the implementation of the assignee trigger feature.


@BenGWeeks BenGWeeks marked this pull request as draft June 21, 2025 15:55
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.

1 participant