Skip to content

Conversation

@badideasforsale
Copy link
Contributor

This PR modifies the trigger word detection to match the complete trigger and only the complete trigger. I use this action extensively (thank you!) but to make iterating on an action easier, I have sometimes needed to have two copies of the action in a repository with two different triggers, i.e. .deploy and .deploy-dev. When making a comment with the latter trigger word, it causes both actions to run.

I have added (with some LLM assistance, as my NodeJS skills are nothing to brag about) an extra if statement to catch this situation along with some test cases.

Copilot AI review requested due to automatic review settings October 24, 2025 21:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances trigger word detection to match complete triggers only, preventing false matches when one trigger is a prefix of another (e.g., .deploy vs .deploy-dev). The change adds validation to ensure that a trigger match is either at the end of the string or followed by whitespace, preventing both actions from running when only one should be triggered.

Key Changes:

  • Added boundary validation after trigger detection to verify complete word matches
  • Implemented comprehensive test coverage for the new validation logic

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/functions/trigger-check.js Added validation to ensure trigger matches are complete by checking the character following the trigger
tests/functions/trigger-check.test.js Added three test cases covering prefix conflicts, alphanumeric suffixes, and whitespace boundaries

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated no new comments.

@GrantBirki GrantBirki requested a review from Copilot October 27, 2025 16:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated no new comments.

@GrantBirki GrantBirki merged commit a41d7bd into github:main Oct 27, 2025
4 checks passed
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.

2 participants