Skip to content

Commit

Permalink
Bring back control to the 'Extract Discussion Number & Close If any W…
Browse files Browse the repository at this point in the history
…here Found' step in 'close-discussion' workflow
  • Loading branch information
og-mrk committed Jul 29, 2024
1 parent 5b47a33 commit 416ab76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/close-discussion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -40,4 +46,3 @@ jobs:
-d '{"state": "closed"}' \
"https://api.github.com/repos/${{ github.repository }}/discussions/$discussion_id"
done
shell: bash

0 comments on commit 416ab76

Please sign in to comment.