From ecce454127507335bb76e7f859c7b11b65409d84 Mon Sep 17 00:00:00 2001 From: Filipe PINTO Date: Thu, 4 May 2023 10:25:39 +0200 Subject: [PATCH] Fix accept workflow when using --release option --- .github/workflows/accept-pull-request.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/accept-pull-request.yml b/.github/workflows/accept-pull-request.yml index 3c412a6dc..33b970885 100644 --- a/.github/workflows/accept-pull-request.yml +++ b/.github/workflows/accept-pull-request.yml @@ -9,7 +9,7 @@ concurrency: accept-pull-request-${{ github.event.issue.number }} jobs: accept-pull-request: - if: ${{ github.event.issue.pull_request && (github.event.comment.body == '/accept' || github.event.comment.body == '/accept --force') }} + if: ${{ github.event.issue.pull_request && (github.event.comment.body == '/accept' || github.event.comment.body == '/accept --force' || github.event.comment.body == '/accept --release') }} env: GITHUB_CONTEXT: ${{ toJson(github) }} GITHUB_TOKEN: ${{ secrets.HURL_BOT_TOKEN }} @@ -74,6 +74,8 @@ jobs: run: | if [[ "${{ github.event.comment.body }}" =~ "--force" ]] ; then order="/accept --force" + elif [[ "${{ github.event.comment.body }}" =~ "--release" ]] ; then + order="/accept --release" else order="/accept" fi @@ -193,10 +195,12 @@ jobs: gh pr comment "${PR_NUMBER}" --body "${comment}" if [[ "${{ github.event.comment.body }}" =~ "--force" ]] ; then order="/accept --force" + elif [[ "${{ github.event.comment.body }}" =~ "--release" ]] ; then + order="/accept --release" else order="/accept" fi - comment="🕗 [${order}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) is still running, please wait for completion." + comment="🕗 [${order}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) is running, please wait for completion." gh pr comment "${PR_NUMBER}" --body "${comment}" sleep 15 else