Skip to content

Commit cb51e2a

Browse files
committed
Fix bot help error when " in bot command
Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>
1 parent a2fad51 commit cb51e2a

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

.github/workflows/bot-command.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,15 @@ permissions:
2727
jobs:
2828
Bot-command-check:
2929
name: Bot command check
30-
if: github.event_name == 'pull_request' || startsWith(github.event.comment.body, '/bot')
30+
if: |
31+
startsWith(github.event.comment.body, '/bot') &&
32+
!(startsWith(github.event.comment.body, '/bot run') ||
33+
startsWith(github.event.comment.body, '/bot skip --comment') ||
34+
startsWith(github.event.comment.body, '/bot reuse-pipeline') ||
35+
startsWith(github.event.comment.body, '/bot kill'))
3136
runs-on: ubuntu-latest
32-
outputs:
33-
status: ${{ steps.check.outputs.status }}
3437
steps:
35-
- id: check
36-
name: Check bot command
37-
run: |
38-
if [[ "${{ github.event.comment.body }}" == "/bot run"* ]] ||
39-
[[ "${{ github.event.comment.body }}" == "/bot skip --comment"* ]] ||
40-
[[ "${{ github.event.comment.body }}" == "/bot reuse-pipeline"* ]] ||
41-
[[ "${{ github.event.comment.body }}" == "/bot kill"* ]]; then
42-
echo 'status=success' >> $GITHUB_OUTPUT
43-
else
44-
echo 'status=failure' >> $GITHUB_OUTPUT
45-
fi
4638
- name: Add bot help comment
47-
if: steps.check.outputs.status == 'failure'
4839
uses: actions/github-script@v6
4940
with:
5041
script: |

a.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)