From 416ab767155c2c7a40876b6af99d9d00441467c3 Mon Sep 17 00:00:00 2001 From: "Mr.k" Date: Mon, 29 Jul 2024 10:01:25 +0300 Subject: [PATCH] Bring back control to the 'Extract Discussion Number & Close If any Where Found' step in 'close-discussion' workflow --- .github/workflows/close-discussion.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/close-discussion.yaml b/.github/workflows/close-discussion.yaml index a0ef0fd5fd..28d982a1e4 100644 --- a/.github/workflows/close-discussion.yaml +++ b/.github/workflows/close-discussion.yaml @@ -13,6 +13,12 @@ jobs: run: echo "PR was merged" - name: Extract Discussion Number & Close If any Where Found + # Make the running bash script behave like it would when ran locally + # by default GitHub actions has 'set -e', which'll make the whole step fail + # upon small things, like grep not finding any matches.. which sometimes + # we do want this behavior, so we set shell to be 'bash {0}' to bring back control. + # reference: https://stackoverflow.com/questions/73066461/github-actions-why-an-intermediate-command-failure-in-shell-script-would-cause + shell: bash {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: github.event.pull_request.merged == true @@ -40,4 +46,3 @@ jobs: -d '{"state": "closed"}' \ "https://api.github.com/repos/${{ github.repository }}/discussions/$discussion_id" done - shell: bash