diff --git a/.github/workflows/GetDownloadCount.yml b/.github/workflows/GetDownloadCount.yml index db93c0c..525a51c 100644 --- a/.github/workflows/GetDownloadCount.yml +++ b/.github/workflows/GetDownloadCount.yml @@ -22,16 +22,19 @@ jobs: # Debug: Print releases to check the response echo "Releases data: $releases" + echo "test0" + # Check if releases is empty or not valid JSON if [ -z "$releases" ] || ! echo "$releases" | jq empty; then echo "Error: No releases found or invalid JSON response." exit 1 fi + # Initialize variables for max downloads max_download_count=0 release_with_max_downloads="" - # Iterate through each release + # Iterate through each release echo "$releases" | jq -c '.[]' | while read -r release; do release_data=$(echo "$release" | jq '.') download_count=$(echo "$release_data" | jq '[.assets[].download_count // 0] | add')