forked from kyma-project/eventing-manager
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: added job to bump the rc-tag in the sec-scanners-config on m…
…ain branch when creating release (kyma-project#543) * Create release also bumps the rc-tag in the sec-scanners-config on main * fixed script * added timeout
- Loading branch information
Showing
2 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# standard bash error handling | ||
set -o nounset # treat unset variables as an error and exit immediately. | ||
set -o errexit # exit immediately when a command fails. | ||
set -E # needs to be set if we want the ERR trap | ||
set -o pipefail # prevents errors in a pipeline from being masked | ||
|
||
# Expected environment variables: | ||
# PR_URL - Number of the PR with the changes to be merged | ||
|
||
# wait until the PR is merged. | ||
while true ; do | ||
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 | ||
fi | ||
echo "Waiting for ${PR_URL} to be merged" | ||
sleep 10 | ||
done |