From bd893422265058f66937dc95ad0a6a08b82dcc02 Mon Sep 17 00:00:00 2001 From: Nycholas de Oliveira e Oliveira Date: Sat, 20 Jan 2024 09:03:19 -0300 Subject: [PATCH] change the way to start workflow by comment issue --- .github/workflows/tests.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ae9525f6..5a285d32 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,10 +7,11 @@ on: - release/** tags-ignore: - v** - pull_request_review_comment: + issue_comment: types: [created] permissions: + actions: write contents: read jobs: @@ -24,9 +25,17 @@ jobs: - ubuntu-latest steps: - name: Check comment review - if: ${{ github.event_name == 'pull_request_review_comment' && !contains(github.event.comment.body, 'github-actions-workflow-tests') )} + if: >- + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + !contains(github.event.issue.body, 'github-actions-workflow: tests') + uses: action-pack/cancel@v1 + - name: Comment about start of workflow + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_ID: ${{ github.event.pull_request.html_url }} run: | - exit 1 + gh pr comment $PR_ID --body 'The "Tests [Docker]" workflow will be started.' unit-tests: name: Unit tests