From 1c4c45cfdd05b10546654b71e376dbbe3338b304 Mon Sep 17 00:00:00 2001 From: Luca LeBlanc <67206487+yodaluca23@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:02:44 -0500 Subject: [PATCH] Update Build and Release.yml --- .github/workflows/Build and Release.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Build and Release.yml b/.github/workflows/Build and Release.yml index 016ce91..f9e8073 100644 --- a/.github/workflows/Build and Release.yml +++ b/.github/workflows/Build and Release.yml @@ -43,7 +43,28 @@ jobs: if: ${{ github.event.inputs.EEVEEVERSION == '' || github.event.inputs.EEVEEVERSION == null }} run: | echo "EEVEEVERSION not provided, fetching latest release tag..." - echo "REALEEVEEVERSION=$(curl -s "https://api.github.com/repos/whoeevee/EeveeSpotify/releases/latest" | jq -r '.tag_name')" >> $GITHUB_ENV + max_attempts=5 + attempt=0 + success=false + while [ $attempt -lt $max_attempts ]; do + attempt=$((attempt+1)) + echo "Attempt $attempt to fetch latest release tag..." + REALEEVEEVERSION=$(curl -s "https://api.github.com/repos/whoeevee/EeveeSpotify/releases/latest" | jq -r '.tag_name') + if [ -n "$REALEEVEEVERSION" ] && [ "$REALEEVEEVERSION" != "null" ]; then + success=true + break + fi + echo "Failed to fetch latest release tag, retrying..." + sleep 5 # Wait for a short period before retrying + done + + if [ "$success" = true ]; then + echo "Successfully fetched latest release tag: $REALEEVEEVERSION" + else + echo "Failed to fetch the latest release tag after $max_attempts attempts. + fi + + echo "REALEEVEEVERSION=$REALEEVEEVERSION" >> $GITHUB_ENV - name: Set RealEeveeVersion if tag provided if: ${{ env.EEVEEVERSION != '' }}