diff --git a/src/github/validation/trigger.ts b/src/github/validation/trigger.ts index 74b385d8d..01724e0f0 100644 --- a/src/github/validation/trigger.ts +++ b/src/github/validation/trigger.ts @@ -51,6 +51,7 @@ export function checkContainsTrigger(context: ParsedGitHubContext): boolean { // Check for exact match with word boundaries or punctuation const regex = new RegExp( `(^|\\s)${escapeRegExp(triggerPhrase)}([\\s.,!?;:]|$)`, + "i", ); // Check in body @@ -77,6 +78,7 @@ export function checkContainsTrigger(context: ParsedGitHubContext): boolean { // Check for exact match with word boundaries or punctuation const regex = new RegExp( `(^|\\s)${escapeRegExp(triggerPhrase)}([\\s.,!?;:]|$)`, + "i", ); // Check in body @@ -105,6 +107,7 @@ export function checkContainsTrigger(context: ParsedGitHubContext): boolean { // Check for exact match with word boundaries or punctuation const regex = new RegExp( `(^|\\s)${escapeRegExp(triggerPhrase)}([\\s.,!?;:]|$)`, + "i", ); if (regex.test(reviewBody)) { console.log( @@ -125,6 +128,7 @@ export function checkContainsTrigger(context: ParsedGitHubContext): boolean { // Check for exact match with word boundaries or punctuation const regex = new RegExp( `(^|\\s)${escapeRegExp(triggerPhrase)}([\\s.,!?;:]|$)`, + "i", ); if (regex.test(commentBody)) { console.log(`Comment contains exact trigger phrase '${triggerPhrase}'`); diff --git a/test/trigger-validation.test.ts b/test/trigger-validation.test.ts index f235928b8..275164327 100644 --- a/test/trigger-validation.test.ts +++ b/test/trigger-validation.test.ts @@ -186,6 +186,8 @@ describe("checkContainsTrigger", () => { { issueBody: "@claude: here's the issue", expected: true }, { issueBody: "@claude; and another thing", expected: true }, { issueBody: "Hey @claude, can you help?", expected: true }, + { issueBody: "@Claude can you help?", expected: true }, + { issueBody: "@CLAUDE fix this", expected: true }, { issueBody: "claudette contains claude", expected: false }, { issueBody: "email@claude.com", expected: false }, ];