Skip to content

Commit a8043fe

Browse files
committed
review
Signed-off-by: Dean Roehrich <dean.roehrich@hpe.com>
1 parent 4467e62 commit a8043fe

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

tools/release-all/release-all.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,23 @@ verify_clean_build() {
283283
local indent="$3"
284284

285285
msg "${indent}Verifying clean build on GitHub for $default_branch..."
286-
build_status=$(gh run list --repo "$repo_url" --branch "$default_branch" --limit 1 --json conclusion -q '.[0].conclusion' 2>/dev/null || echo "unknown")
287-
if [[ "$build_status" != "success" ]]; then
288-
do_fail "${indent}Build status for $default_branch: $build_status (expected: success)" "$indent"
286+
# shellcheck disable=SC2054
287+
local gh_cmd=(gh run list --repo "$repo_url" --branch "$default_branch" --limit 1 --json status,conclusion -q '.[0] | {"status":.status,"conclusion":.conclusion}')
288+
local build_json
289+
build_json=$("${gh_cmd[@]}" 2>&1)
290+
if echo "$build_json" | grep -q "connection reset by peer"; then
291+
# Retry, but only once.
292+
sleep 1
293+
build_json=$("${gh_cmd[@]}" 2>&1)
294+
fi
295+
local conclusion status
296+
conclusion=$(echo "$build_json" | grep -o '"conclusion": *"[^"]*"' | sed 's/.*": *"\(.*\)"/\1/')
297+
status=$(echo "$build_json" | grep -o '"status": *"[^"]*"' | sed 's/.*": *"\(.*\)"/\1/')
298+
if [[ -z "$conclusion" ]]; then
299+
do_fail "${indent}Build is not yet completed (status: $status)"
300+
fi
301+
if [[ "$conclusion" != "success" ]]; then
302+
do_fail "${indent}Build conclusion for $default_branch: $conclusion (expected: success)"
289303
fi
290304
}
291305

0 commit comments

Comments
 (0)