Skip to content

fix: make trigger_phrase matching case-insensitive#915

Open
Dave-London wants to merge 1 commit intoanthropics:mainfrom
Dave-London:fix/trigger-phrase-case-insensitive
Open

fix: make trigger_phrase matching case-insensitive#915
Dave-London wants to merge 1 commit intoanthropics:mainfrom
Dave-London:fix/trigger-phrase-case-insensitive

Conversation

@Dave-London
Copy link
Contributor

Summary

  • Adds the i (case-insensitive) flag to all four RegExp constructions in checkContainsTrigger
  • Fixes silent trigger rejection when iOS autocorrect capitalizes @claude to @Claude
  • Adds 4 new test cases covering case-insensitive matching across all trigger paths (issue comments, issue body, PR body, PR review body)

Problem

The trigger_phrase regex was constructed without the i flag, making matching case-sensitive. GitHub's workflow-level contains() guard is case-insensitive, so the workflow would run but the action's internal check would silently reject the trigger — a confusing UX gap.

Changes

  • src/github/validation/trigger.ts: Added "i" flag to all 4 new RegExp() calls
  • test/trigger-validation.test.ts: Added case-insensitive trigger matching describe block with tests for @Claude, @CLAUDE, and @cLaUdE variants

Test plan

  • All 30 trigger validation tests pass (bun test test/trigger-validation.test.ts)
  • TypeScript typecheck passes (bun run typecheck)
  • Prettier formatting passes (bun run format:check)

Fixes #910

Add the 'i' flag to all four RegExp constructions in checkContainsTrigger
so that trigger phrases like "@claude" also match "@claude", "@claude", etc.

This fixes a confusing UX issue where iOS autocorrect capitalizes
"@claude" to "@claude", causing GitHub's case-insensitive workflow `if`
guard to run the action but the action's internal trigger check to
silently reject it.

Fixes anthropics#910

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

trigger_phrase matching is case-sensitive, should be case-insensitive

1 participant