File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,23 @@ 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 response
50+ response=$( curl " ${curl_opts[@]} " -H " Accept: application/vnd.github.v3+json" \
51+ " https://api.github.com/repos/${GH_REPO} /releases" )
52+
53+ # Check for GitHub API error (e.g., rate limit exceeded)
54+ if echo " $response " | jq -e ' type == "object" and has("message")' > /dev/null; then
55+ local message
56+ message=$( echo " $response " | jq -r ' .message' )
57+ fail " GitHub API error: $message "
58+ fi
59+
60+ # Validate it's an array
61+ if ! echo " $response " | jq -e ' type == "array"' > /dev/null; then
62+ fail " Unexpected GitHub response (not a release list array): $response "
63+ fi
64+
65+ echo " $response " | jq -r ' .[0].assets[] | "\(.name) \(.browser_download_url)"'
5266}
5367
5468validate_platform () {
You can’t perform that action at this time.
0 commit comments