Skip to content

Commit

Permalink
exit 1 if pr was closed
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 25, 2024
1 parent 76b8ff5 commit 28e0565
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/bump-sec-scanners-config-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#
# If changes were done by the script, the workflow will create a PR and wait for it to be merged.
# The waiting will happen with a timeout that can be set via the input of `timeout`. The units are seconds.
# It has a default value of 3600 (seconds (= 1 hour)).
# It has a default value of 3600 (seconds (= 1 hour)). Note that GitHub Action jobs will automatically fail after 6 hours:
# Further reads:
# Default limits for GitHub Actions: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits
#
# Examples of using this workflow:
# 1. Set all awailable inputs and secrets.
Expand Down Expand Up @@ -169,6 +171,7 @@ jobs:
pr_state=$(gh pr view ${PR_URL} --json state --jq '.state')
if [ "$pr_state" == "CLOSED" ]; then
echo "ERROR! PR has been closed!"
exit 1
elif [ "$pr_state" == "MERGED" ]; then
echo "PR has been merged!"
exit 0
Expand Down

0 comments on commit 28e0565

Please sign in to comment.