From a0ea300e96b534b602c5c4a106b46e1e24c841bf Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 11 Mar 2020 09:54:56 -0300 Subject: [PATCH] Fix bot trigger event Issue events don't contain a 'comment' entry: https://developer.github.com/v3/issues/events/#response-2 Issue comments also contain the original issue body: https://developer.github.com/v3/activity/events/types/#issuecommentevent That's why it was triggering even for comments on the issue. Also changed to startsWith because there's no need to support the command anywhere in the body IMO. Fix #6895 --- .github/workflows/release-on-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-comment.yml b/.github/workflows/release-on-comment.yml index 7db96010b..fe62eb1cb 100644 --- a/.github/workflows/release-on-comment.yml +++ b/.github/workflows/release-on-comment.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest - if: (github.event.comment && contains(github.event.comment.body, '@pytestbot please')) || (github.event.issue && contains(github.event.issue.body, '@pytestbot please')) + if: (github.event.comment && startsWith(github.event.comment.body, '@pytestbot please')) || (github.event.issue && !github.event.comment && startsWith(github.event.issue.body, '@pytestbot please')) steps: - uses: actions/checkout@v1