Skip to content

Commit

Permalink
Update GetDownloadCount.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shupershuff authored Sep 12, 2024
1 parent edb9496 commit be35dcf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/GetDownloadCount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@ jobs:
echo "Error: No releases found or invalid JSON response."
exit 1
fi
echo "test1"
# Initialize variables for max downloads
max_download_count=0
release_with_max_downloads=""
# Loop through all releases and find the one with the highest download count
for release in $(echo "$releases" | jq -c '.[]'); do
echo "test2"
# Iterate through each release
echo "test1"
echo "$releases" | jq -c '.[]' | while read -r release; do
echo "test2"
release_data=$(echo "$release" | jq '.')
echo "test2.5"
echo "test3"
download_count=$(echo "$release_data" | jq '[.assets[].download_count // 0] | add')
echo "test3"
echo "test4"
# Check if this release has more downloads than the current max
if [ "$download_count" -gt "$max_download_count" ]; then
echo "test4 is max so far"
max_download_count=$download_count
release_with_max_downloads=$(echo "$release_data" | jq -r '.tag_name')
fi
Expand Down

0 comments on commit be35dcf

Please sign in to comment.