Skip to content

fix: match label_trigger case-insensitively - #1576

Open
sahilempire wants to merge 1 commit into
anthropics:mainfrom
sahilempire:fix/label-trigger-case-insensitive
Open

fix: match label_trigger case-insensitively#1576
sahilempire wants to merge 1 commit into
anthropics:mainfrom
sahilempire:fix/label-trigger-case-insensitive

Conversation

@sahilempire

Copy link
Copy Markdown

Summary

label_trigger matched labels with a case-sensitive exact comparison, so a
workflow configured with label_trigger: "claude-task" did not fire when an
issue received a label named Claude-Task (the same label name in different
casing).

Fix

Compare the incoming label name and the configured label_trigger with
toLowerCase() in checkContainsTrigger. GitHub label names are unique
without regard to case, so this comparison is unambiguous. It also matches the
trigger_phrase check in the same function, which is already case-insensitive.

Tests

Added a unit test covering a label whose name differs from the trigger only in
case. All checks pass locally:

  • bun test (805 pass, 0 fail)
  • bun run typecheck (clean)
  • bun run format:check (clean)

Fixes #1571

label_trigger used a case-sensitive exact comparison, so a workflow
configured with label_trigger: "claude-task" did not fire when an issue
received a label named "Claude-Task" (the same label name with different
casing).

GitHub label names are unique without regard to case, so comparing without
case is unambiguous. It also matches the trigger_phrase check in the same
function, which is already case-insensitive.

Compare labelName and labelTrigger with toLowerCase(), and add a test
covering a mixed-case label.

Fixes anthropics#1571
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.

label_trigger matching is case-sensitive and misses mixed-case label events

1 participant