Skip to content

Make trigger phrase matching case-insensitive#1078

Open
mezoistvan wants to merge 1 commit intoanthropics:mainfrom
mezoistvan:main
Open

Make trigger phrase matching case-insensitive#1078
mezoistvan wants to merge 1 commit intoanthropics:mainfrom
mezoistvan:main

Conversation

@mezoistvan
Copy link
Copy Markdown

Users may type @Claude, @CLAUDE, etc. in issues, PRs, and comments. Adding the i flag to all trigger regex patterns ensures these variations are recognized correctly.

Made-with: Cursor

Users may type `@Claude`, `@CLAUDE`, etc. in issues, PRs, and comments.
Adding the `i` flag to all trigger regex patterns ensures these variations
are recognized correctly.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

LGTM — straightforward addition of the "i" flag to all four trigger regex instances, with good test coverage.

Extended reasoning...

Overview

This PR adds the case-insensitive ("i") flag to all four new RegExp(...) calls in src/github/validation/trigger.ts — covering issue body/title, PR body/title, PR review body, and comment body triggers. Two new test cases verify case-insensitive matching for issue and comment contexts.

Security risks

None. The change only relaxes matching strictness (case-insensitive instead of case-sensitive) on trigger phrase detection. There is no injection risk since escapeRegExp is already applied to the trigger phrase before embedding it in the regex pattern.

Level of scrutiny

Low scrutiny is appropriate. This is a small, mechanical change — adding a single flag argument to four identical regex constructions. The intent is clear, the implementation is correct, and the tests adequately cover the new behavior.

Other factors

The change is consistent across all four code paths, and the tests cover multiple casing variations (@Claude, @CLAUDE, @cLaUdE). No existing tests should be affected since the "i" flag only broadens what matches. No outstanding reviewer comments or prior reviews to consider.

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