Summary
parseGittensoryMentionCommand matches the bot handle with /(?:^|\s)@gittensory(?:\s+([a-z-]+))?([^\n\r]*)/i, which has no boundary after @gittensory. The handle therefore matches as a prefix of a longer GitHub username, so a comment that mentions a different account whose name starts with gittensory (e.g. @gittensory-bot, @gittensory2) is parsed as a bare @gittensory help command — and the bot posts an unsolicited help reply on that thread.
Area
GitHub App
Expected behavior
A mention only counts when the handle is exactly @gittensory followed by a word boundary (whitespace, punctuation, or end-of-text). @gittensory-bot please look should return null (it mentions another user), while @gittensory ask ... still parses.
Actual behavior
parseGittensoryMentionCommand("@gittensory-bot please take a look") returns a help command (the optional command group requires leading whitespace, so -bot is not consumed and match[1] is undefined → defaults to help). The only caller (maybeProcessGittensoryMentionCommand) then posts a public @gittensory help answer card for a mention that was never directed at the bot.
Reproduction
parseGittensoryMentionCommand("@gittensory-bot please take a look") returns { name: "help", ... } (expected null). Same for @gittensory2 ..., @gittensorybot ....
Validation
Unit tests added asserting @gittensory-bot / @gittensory2 / @gittensorybot return null, while bare @gittensory, @gittensory ask ..., and punctuation boundaries (@gittensory, ...) still parse.
Public-safety check
Summary
parseGittensoryMentionCommandmatches the bot handle with/(?:^|\s)@gittensory(?:\s+([a-z-]+))?([^\n\r]*)/i, which has no boundary after@gittensory. The handle therefore matches as a prefix of a longer GitHub username, so a comment that mentions a different account whose name starts withgittensory(e.g.@gittensory-bot,@gittensory2) is parsed as a bare@gittensory helpcommand — and the bot posts an unsolicited help reply on that thread.Area
GitHub App
Expected behavior
A mention only counts when the handle is exactly
@gittensoryfollowed by a word boundary (whitespace, punctuation, or end-of-text).@gittensory-bot please lookshould returnnull(it mentions another user), while@gittensory ask ...still parses.Actual behavior
parseGittensoryMentionCommand("@gittensory-bot please take a look")returns ahelpcommand (the optional command group requires leading whitespace, so-botis not consumed andmatch[1]is undefined → defaults tohelp). The only caller (maybeProcessGittensoryMentionCommand) then posts a public@gittensory helpanswer card for a mention that was never directed at the bot.Reproduction
parseGittensoryMentionCommand("@gittensory-bot please take a look")returns{ name: "help", ... }(expectednull). Same for@gittensory2 ...,@gittensorybot ....Validation
Unit tests added asserting
@gittensory-bot/@gittensory2/@gittensorybotreturnnull, while bare@gittensory,@gittensory ask ..., and punctuation boundaries (@gittensory, ...) still parse.Public-safety check