Skip to content

Commit d3cd937

Browse files
authored
update shell scripts (#79)
1 parent b29595e commit d3cd937

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

bulk-pr/pr_approve

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PR_BRANCH_NAME=${1:?Must provide name of PR branch to operate on.}
44
source repos
55
for product in "${products[@]}"; do
66
STATE=$(gh pr view ${PR_BRANCH_NAME} -R stackabletech/${product}-operator --jq '.state' --json state)
7-
if [[ $STATE -eq "OPEN" ]]; then
7+
if [[ "$STATE" == "OPEN" ]]; then
88
echo "Approving ${product}"
99
gh pr review ${PR_BRANCH_NAME} --approve -R stackabletech/${product}-operator
1010
gh pr merge ${PR_BRANCH_NAME} -R stackabletech/${product}-operator

bulk-pr/pr_status

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ set -euo pipefail
33
PR_BRANCH_NAME=${1:?Must provide name of PR branch to operate on.}
44
source repos
55
for product in "${products[@]}"; do
6-
STATE=$(gh pr view ${PR_BRANCH_NAME} -R stackabletech/${product}-operator --jq '.state' --json state)
7-
gh pr checks ${PR_BRANCH_NAME} -R stackabletech/${product}-operator &> /dev/null
6+
STATE=$(gh pr view ${PR_BRANCH_NAME} -R stackabletech/${product}-operator --jq '.state' --json state)
7+
# Disable -e option to the "set" command below because it causes the script to stop if checks are in progress.
8+
set +e
9+
gh pr checks ${PR_BRANCH_NAME} -R stackabletech/${product}-operator &>/dev/null
10+
set -e
811
status=$?
912
echo "${product}(${STATE}): ${status}"
1013
done

0 commit comments

Comments
 (0)