Skip to content

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

@jackdempsey

Description

@jackdempsey

Problem

The trigger_phrase matching in src/github/validation/trigger.ts is case-sensitive. The regex is constructed without the i flag:

const regex = new RegExp(
  `(^|\\s)${escapeRegExp(triggerPhrase)}([\\s.,!?;:]|$)`,
);

This means trigger_phrase: "@claude" will not match @Claude, @CLAUDE, etc.

Why this matters

On mobile (iOS autocorrect), typing @claude often gets capitalized to @Claude. The workflow-level if guard uses GitHub's contains() function which is case-insensitive, so the workflow runs — but the action's internal trigger check rejects it silently:

trigger_phrase: @claude
No trigger was met for @claude
Trigger result: false
No trigger found, skipping remaining steps

This is confusing because the workflow ran (meaning the comment did contain @claude per GitHub's case-insensitive contains()), but the action decided it didn't match.

Suggested fix

Add the i flag to the RegExp constructor:

const regex = new RegExp(
  `(^|\\s)${escapeRegExp(triggerPhrase)}([\\s.,!?;:]|$)`,
  'i',
);

This applies to all the trigger checks in checkContainsTrigger.

Environment

  • Action version: v1
  • Trigger phrase: @claude (default)
  • Comment text: @Claude do this (capital C, typed on iOS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Non-showstopper bug or popular feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions