File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,21 @@ sort_versions() {
4646}
4747
4848fetch_all_assets () {
49- curl -s -H " Accept: application/vnd.github.v3+json" \
50- https://api.github.com/repos/${GH_REPO} /releases |
51- jq -r ' .[0].assets[] | "\(.name) \(.browser_download_url)"'
49+ local attempts=0
50+ local releases_json
51+ while [ $attempts -lt 5 ]; do
52+ releases_json=" $( curl -s -H " Accept: application/vnd.github.v3+json" \
53+ https://api.github.com/repos/${GH_REPO} /releases) "
54+ if echo " $releases_json " | jq -e ' type == "array"' > /dev/null; then
55+ echo " $releases_json " | jq -r ' .[0].assets[] | "\(.name) \(.browser_download_url)"'
56+ return 0
57+ fi
58+ log " Failed to fetch releases (attempt $(( attempts+ 1 )) ). Retrying in 2s..."
59+ sleep 2
60+ attempts=$(( attempts+ 1 ))
61+ done
62+ echo " $releases_json " | jq ' .' # Print last error
63+ fail " GitHub API did not return a valid releases array after $attempts attempts."
5264}
5365
5466validate_platform () {
You can’t perform that action at this time.
0 commit comments