Fix slash command handler trigger condition by trimming the comments (#17691)
This commit is contained in:
@@ -12,13 +12,14 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
slash_command:
|
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: >
|
if: >
|
||||||
github.event.issue.pull_request &&
|
github.event.issue.pull_request &&
|
||||||
(startsWith(github.event.comment.body, '/tag-run-ci-label') ||
|
(contains(github.event.comment.body, '/tag-run-ci-label') ||
|
||||||
startsWith(github.event.comment.body, '/rerun-failed-ci') ||
|
contains(github.event.comment.body, '/rerun-failed-ci') ||
|
||||||
startsWith(github.event.comment.body, '/tag-and-rerun-ci') ||
|
contains(github.event.comment.body, '/tag-and-rerun-ci') ||
|
||||||
startsWith(github.event.comment.body, '/rerun-stage'))
|
contains(github.event.comment.body, '/rerun-stage'))
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
Reference in New Issue
Block a user