File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,22 @@ download_gh_cli() {
3232 local platform=$1
3333 local file_extension=$2
3434 if [ " $PARAM_GH_CLI_VERSION " = " latest" ]; then
35- LATEST_TAG=$( curl url -s https://api.github.com/repos/cli/cli/releases/latest | jq -r ' .tag_name' )
35+ max_retries=3
36+ i=0
37+ while (( i < max_retries )) ; do
38+ (( i++ ))
39+ LATEST_TAG=$( curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r ' .tag_name' )
40+ if [ " $LATEST_TAG " != null ]; then
41+ break
42+ fi
43+ echo " Couldn't get latest version, retrying..."
44+ sleep 3
45+ done
46+ if (( i == max_retries )) ; then
47+ echo " Erro: Max retries exceeded"
48+ exit 1
49+ fi
50+
3651 PARAM_GH_CLI_VERSION=" ${LATEST_TAG# v} "
3752 fi
3853 local download_url=" https://github.com/cli/cli/releases/download/v${PARAM_GH_CLI_VERSION} /gh_${PARAM_GH_CLI_VERSION} _${platform} .${file_extension} "
You can’t perform that action at this time.
0 commit comments