Skip to content

Commit c0c6b01

Browse files
authored
fix: make git run watch optional in release_rc.sh (#720)
1 parent 0284683 commit c0c6b01

1 file changed

Lines changed: 28 additions & 23 deletions

File tree

dev/release/release_rc.sh

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ rc=$2
4444
: "${RELEASE_PUSH_TAG:=${RELEASE_DEFAULT}}"
4545
: "${RELEASE_SIGN:=${RELEASE_DEFAULT}}"
4646
: "${RELEASE_UPLOAD:=${RELEASE_DEFAULT}}"
47+
: "${RELEASE_WATCH:=${RELEASE_DEFAULT}}"
4748
: "${RELEASE_WATCH_INTERVAL:=30}"
4849

4950
cd "${SOURCE_TOP_DIR}"
@@ -97,29 +98,33 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then
9798
done
9899

99100
echo "Found GitHub Actions workflow with ID: ${run_id}"
100-
while true; do
101-
run_status=$(gh run view \
102-
--repo "${repository}" \
103-
--json 'status,conclusion' \
104-
--jq '.status + " " + (.conclusion // "")' \
105-
"${run_id}")
106-
echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}"
107-
gh run view \
108-
--repo "${repository}" \
109-
--json jobs \
110-
--jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \
111-
"${run_id}"
112-
case "${run_status}" in
113-
"completed success")
114-
break
115-
;;
116-
completed\ *)
117-
echo "GitHub Actions workflow did not complete successfully: ${run_status}"
118-
exit 1
119-
;;
120-
esac
121-
sleep "${RELEASE_WATCH_INTERVAL}"
122-
done
101+
if [ "${RELEASE_WATCH}" -gt 0 ]; then
102+
gh run watch --repo "${repository}" --exit-status "${run_id}"
103+
else
104+
while true; do
105+
run_status=$(gh run view \
106+
--repo "${repository}" \
107+
--json 'status,conclusion' \
108+
--jq '.status + " " + (.conclusion // "")' \
109+
"${run_id}")
110+
echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}"
111+
gh run view \
112+
--repo "${repository}" \
113+
--json jobs \
114+
--jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \
115+
"${run_id}"
116+
case "${run_status}" in
117+
"completed success")
118+
break
119+
;;
120+
completed\ *)
121+
echo "GitHub Actions workflow did not complete successfully: ${run_status}"
122+
exit 1
123+
;;
124+
esac
125+
sleep "${RELEASE_WATCH_INTERVAL}"
126+
done
127+
fi
123128

124129
mkdir -p "${rc_id}"
125130

0 commit comments

Comments
 (0)