ci(update-zen-browser): added retry logic when upstream has 'null' value
This commit is contained in:
20
.github/update-zen-browser.bash
vendored
20
.github/update-zen-browser.bash
vendored
@@ -2,6 +2,26 @@
|
||||
|
||||
script_dir="$(dirname -- "$0")"
|
||||
|
||||
upstream="null"
|
||||
|
||||
max_attempts=10
|
||||
attempts=1
|
||||
|
||||
while [ "$upstream" == "null" ]; do
|
||||
upstream=$("$script_dir/new-version.sh")
|
||||
|
||||
if [ "$upstream" != "null" ]; then
|
||||
break
|
||||
elif [ $attempts -ge $max_attempts ]; then
|
||||
echo "Unable to determine new upstream version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[attempt #${attempts}] Unable to determine new upstream version, retrying in 5 seconds..."
|
||||
attempts=$((attempts + 1))
|
||||
sleep 5
|
||||
done
|
||||
|
||||
upstream=$("$script_dir/new-version.sh" | cat -)
|
||||
if [ "$upstream" == "null" ]; then
|
||||
echo "Unable to determine new upstream version"
|
||||
|
||||
Reference in New Issue
Block a user