mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +00:00
Enable exit on error immediately after download attempt (#7444)
This commit is contained in:
committed by
GitHub
parent
ff9186f1dc
commit
bea98d0749
@@ -28,6 +28,7 @@ download_with_retries() {
|
|||||||
set +e
|
set +e
|
||||||
http_code=$(eval $COMMAND)
|
http_code=$(eval $COMMAND)
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
set -e
|
||||||
if [ $http_code -eq 200 ] && [ $exit_code -eq 0 ]; then
|
if [ $http_code -eq 200 ] && [ $exit_code -eq 0 ]; then
|
||||||
echo "Download completed"
|
echo "Download completed"
|
||||||
return 0
|
return 0
|
||||||
@@ -35,8 +36,6 @@ download_with_retries() {
|
|||||||
echo "Error — Either HTTP response code for '$URL' is wrong - '$http_code' or exit code is not 0 - '$exit_code'. Waiting $interval seconds before the next attempt, $retries attempts left"
|
echo "Error — Either HTTP response code for '$URL' is wrong - '$http_code' or exit code is not 0 - '$exit_code'. Waiting $interval seconds before the next attempt, $retries attempts left"
|
||||||
sleep $interval
|
sleep $interval
|
||||||
fi
|
fi
|
||||||
# Enable exit on error back
|
|
||||||
set -e
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Could not download $URL"
|
echo "Could not download $URL"
|
||||||
|
|||||||
Reference in New Issue
Block a user