From 78cd4050bc930df045a960d3eff9315967cfe301 Mon Sep 17 00:00:00 2001 From: shupershuff <63577525+shupershuff@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:35:17 +1200 Subject: [PATCH] Update GetDownloadCount.yml --- .github/workflows/GetDownloadCount.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/GetDownloadCount.yml b/.github/workflows/GetDownloadCount.yml index abc17ad..c195444 100644 --- a/.github/workflows/GetDownloadCount.yml +++ b/.github/workflows/GetDownloadCount.yml @@ -18,12 +18,19 @@ jobs: id: fetch_release run: | release_data=$(curl -s https://api.github.com/repos/shupershuff/diablo2rloader/releases/latest) + echo "Fetched release data: $release_data" echo "::set-output name=release_data::${release_data}" - name: Calculate Download Count id: calculate_downloads run: | - download_count=$(echo "${{ steps.fetch_release.outputs.release_data }}" | jq '[.assets[].download_count] | add') + echo "Release data JSON: ${{ steps.fetch_release.outputs.release_data }}" + download_count=$(echo '${{ steps.fetch_release.outputs.release_data }}' | jq '[.assets[].download_count] | add') + if [ -z "$download_count" ]; then + #echo "No download count found, setting to 0" + download_count=0 + fi + echo "Download count: $download_count" echo "::set-output name=download_count::${download_count}" - name: Update JSON File