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: