[CI] Answer unrecognized slash commands instead of skipping silently (#38736)

This commit is contained in:
Alison Shao
2026-09-09 18:01:18 -07:00
committed by GitHub
parent 92d831d3d7
commit a7e00b7576
3 changed files with 78 additions and 2 deletions
+8 -1
View File
@@ -14,6 +14,10 @@ jobs:
slash_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
#
# The trailing startsWith() namespace clauses admit *unrecognized* commands
# so the script can answer them; they are startsWith() because
# contains('/run-') would fire on any comment quoting `scripts/run-tests.sh`.
if: >
github.event.issue.pull_request &&
(contains(github.event.comment.body, '/tag-run-ci-label') ||
@@ -24,7 +28,10 @@ jobs:
contains(github.event.comment.body, '/rerun-full-ci') ||
contains(github.event.comment.body, '/rerun-extra-ci') ||
contains(github.event.comment.body, '/rerun-group') ||
contains(github.event.comment.body, '/rerun-test'))
contains(github.event.comment.body, '/rerun-test') ||
startsWith(github.event.comment.body, '/tag-') ||
startsWith(github.event.comment.body, '/rerun-') ||
startsWith(github.event.comment.body, '/run-'))
runs-on: ubuntu-latest
steps: