Fix slash command handler trigger condition by trimming the comments (#17691)

This commit is contained in:
Kangyan-Zhou
2026-01-24 18:54:46 -08:00
committed by GitHub
parent 59f027a8c8
commit b829b797ef

View File

@@ -12,13 +12,14 @@ permissions:
jobs:
slash_command:
# Only run if it is a PR and the comment starts with a recognized command
# Only run if it is a PR and the comment contains a recognized command
# Use contains() since startsWith() can't handle leading whitespace/newlines
if: >
github.event.issue.pull_request &&
(startsWith(github.event.comment.body, '/tag-run-ci-label') ||
startsWith(github.event.comment.body, '/rerun-failed-ci') ||
startsWith(github.event.comment.body, '/tag-and-rerun-ci') ||
startsWith(github.event.comment.body, '/rerun-stage'))
(contains(github.event.comment.body, '/tag-run-ci-label') ||
contains(github.event.comment.body, '/rerun-failed-ci') ||
contains(github.event.comment.body, '/tag-and-rerun-ci') ||
contains(github.event.comment.body, '/rerun-stage'))
runs-on: ubuntu-latest
steps: