Skip to content

Commit

Permalink
Update Build and Release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yodaluca23 authored Jun 23, 2024
1 parent 923978e commit 1c4c45c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/Build and Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '' }}
Expand Down

0 comments on commit 1c4c45c

Please sign in to comment.