Skip auto-label flow when TRIGGER_STRING is unset#280
Merged
robandpdx merged 4 commits intoMay 27, 2026
Conversation
When TRIGGER_STRING is not configured, String.prototype.includes() coerces undefined to the literal string "undefined". A PR body or comment containing the word "undefined" could therefore falsely match and trigger the auto-label flow. Add an early-return guard at the top of the pull_request.opened and issue_comment.created handlers — matching the existing AUTHORIZED_TEAM check in isAuthorized — so an unset or empty TRIGGER_STRING disables the trigger feature entirely instead of matching a coerced string.
There was a problem hiding this comment.
Pull request overview
This PR prevents false-positive auto-labeling when TRIGGER_STRING is unset by adding an early-return guard in the pull_request.opened and issue_comment.created handlers, so the trigger feature is effectively disabled unless explicitly configured.
Changes:
- Added an early-return guard in
pull_request.openedwhenTRIGGER_STRINGis unset/empty. - Added an early-return guard in
issue_comment.createdwhenTRIGGER_STRINGis unset/empty.
Show a summary per file
| File | Description |
|---|---|
| app.js | Adds guards to skip auto-label trigger matching when TRIGGER_STRING is not configured. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 6
robandpdx
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
TRIGGER_STRINGis not configured,String.prototype.includes()coercesundefinedto the literal string"undefined". A PR body or comment containing the word "undefined" could therefore falsely match and trigger the auto-label flow — applying the emergency label automatically if the sender also passesisAuthorized(which itself returnstruewhenAUTHORIZED_TEAMis unset).This adds an early-return guard at the top of the
pull_request.openedandissue_comment.createdhandlers — matching the existingAUTHORIZED_TEAMcheck inisAuthorized— so an unset or emptyTRIGGER_STRINGdisables the trigger feature entirely instead of matching a coerced string.The
pull_request.labeledhandler does not referenceTRIGGER_STRINGand is unchanged.