Skip to content

feat: add support for pull request reviewer triggers - #12

Merged
markwylde merged 1 commit into
markwylde:giteafrom
OlegZee:feature/trigger-pr-byreviewer
Oct 17, 2025
Merged

feat: add support for pull request reviewer triggers#12
markwylde merged 1 commit into
markwylde:giteafrom
OlegZee:feature/trigger-pr-byreviewer

Conversation

@OlegZee

@OlegZee OlegZee commented Oct 16, 2025

Copy link
Copy Markdown

This PR adds minor feature:

  • Adding @claude to reviewers list for a PR triggers action as if @claude was mentioned in body/comment

This feature is similar to Github's Copilot reviewer.
Having this feature allows to add @claude to default reviewers for protected branch.

What Changed

  • Enhanced trigger detection: The checkContainsTrigger function now checks if the trigger user is in the requested_reviewers list
  • Consistent behavior: Reviewer assignment is treated exactly the same as text mentions in PR body/title
  • Simple implementation: Only ~10 lines of additional code for maximum maintainability
  • Comprehensive tests: Added test coverage for the new reviewer trigger functionality

Example Usage

Previously, you had to manually mention @claude in PR description:

@claude please review this PR

Now you can simply add @claude as a reviewer via GitHub UI, and the action will trigger automatically.

Benefits

  • Workflow automation: Perfect for protected branches where you want Claude to automatically review all PRs
  • User-friendly: No need to remember to mention @claude in text - just add as reviewer
  • Consistent with GitHub patterns: Similar to how Copilot and other GitHub integrations work
  • Backwards compatible: Existing text-based triggers continue to work unchanged

- Add support for pull request review_requested action in checkContainsTrigger function
- Add support for pull request reviewer trigger in checkContainsTrigger function
- Update pull request reviewer trigger to handle reviewer-list similarly to reference in body/comment
- Add debug logging for requested reviewers in pull request trigger check
- Additional improvements to pull request reviewer trigger functionality
@markwylde
markwylde requested a review from Copilot October 17, 2025 07:53

Copilot AI left a comment

Copy link
Copy Markdown

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 support for triggering Claude actions when @claude is added as a reviewer to a pull request, treating reviewer assignment the same as text mentions. This provides a more automated workflow for protected branches and aligns with GitHub's Copilot reviewer pattern.

  • Enhanced trigger detection to check if the trigger user is in the requested_reviewers list
  • Added comprehensive test coverage for the new reviewer trigger functionality
  • Updated documentation to clarify that assignee_trigger works for both issues and PRs

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/github/validation/trigger.ts Added logic to check requested_reviewers array and treat matches as triggers
test/trigger-validation.test.ts Added extensive test suite covering reviewer trigger scenarios including edge cases
README.md Updated assignee_trigger documentation to mention PR assignment support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@markwylde markwylde left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@markwylde
markwylde merged commit 92631f4 into markwylde:gitea Oct 17, 2025
5 of 15 checks passed
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.

4 participants