Skip to content

fix: try to fix CI failures on macOS #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,17 @@ sort_versions() {
}

fetch_all_assets() {
curl -s -H "Accept: application/vnd.github.v3+json" \
https://github.com/api/repos/${GH_REPO}/releases |
jq -r '.[0].assets[] | "\(.name) \(.browser_download_url)"'
local releases_json
releases_json="$(curl -s -H "Accept: application/vnd.github.v3+json" \
https://github.com/api/repos/${GH_REPO}/releases)"

# Validate that the response is an array (successful), otherwise print and fail
if ! echo "$releases_json" | jq -e 'type == "array"' >/dev/null; then
echo "$releases_json" | jq '.' # Optionally print error for debugging
fail "GitHub API did not return a valid releases array - likely rate-limited or network error."
fi

echo "$releases_json" | jq -r '.[0].assets[] | "\(.name) \(.browser_download_url)"'
}

validate_platform() {
Expand Down
Loading