From 8e72f4e5ff576e86fb10b2e90b564c1f1fc51ad2 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Fri, 18 Jul 2025 12:01:22 +0000 Subject: [PATCH 1/2] test: remove versions to test less --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c06842..a56cd1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: command: clang-tidy --version - plugin: clang-apply-replacements command: clang-apply-replacements --version - version: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"] + version: ["16", "17", "18", "19", "20"] steps: - name: Install asdf From 71dcec7e42ba604553aa0789df8078e0438f068a Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Fri, 18 Jul 2025 16:29:10 +0300 Subject: [PATCH 2/2] Update utils.bash --- lib/utils.bash | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/utils.bash b/lib/utils.bash index cc716cb..d205d24 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -46,9 +46,23 @@ sort_versions() { } fetch_all_assets() { - curl -s -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/${GH_REPO}/releases | - jq -r '.[0].assets[] | "\(.name) \(.browser_download_url)"' + local response + response=$(curl "${curl_opts[@]}" -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${GH_REPO}/releases") + + # Check for GitHub API error (e.g., rate limit exceeded) + if echo "$response" | jq -e 'type == "object" and has("message")' >/dev/null; then + local message + message=$(echo "$response" | jq -r '.message') + fail "GitHub API error: $message" + fi + + # Validate it's an array + if ! echo "$response" | jq -e 'type == "array"' >/dev/null; then + fail "Unexpected GitHub response (not a release list array): $response" + fi + + echo "$response" | jq -r '.[0].assets[] | "\(.name) \(.browser_download_url)"' } validate_platform() {