From b829b797ef91f55d2a990df0746892eafae68f0b Mon Sep 17 00:00:00 2001 From: Kangyan-Zhou Date: Sat, 24 Jan 2026 18:54:46 -0800 Subject: [PATCH] Fix slash command handler trigger condition by trimming the comments (#17691) --- .github/workflows/slash-command-handler.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/slash-command-handler.yml b/.github/workflows/slash-command-handler.yml index 370b11cc7..1293dc845 100644 --- a/.github/workflows/slash-command-handler.yml +++ b/.github/workflows/slash-command-handler.yml @@ -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: