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 22, 2024
1 parent a4fd128 commit c8eb49e
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/Build and Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,25 @@ jobs:
export REALEEVEEVERSION=$(curl -s "https://api.github.com/repos/whoeevee/EeveeSpotify/releases/latest" | jq -r '.tag_name')
echo "REALEEVEEVERSION=$REALEEVEEVERSION" >> $GITHUB_ENV
- name: Set REALEEVEEVERSION based on input
if: ${{ github.event.inputs.EEVEEVERSION != '' && github.event.inputs.EEVEEVERSION != null }}
id: find-release
uses: octokit/request-action@v2.x
with:
route: GET /repos/whoeevee/EeveeSpotify/releases
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
env:
EEVEEVERSION: ${{ github.event.inputs.EEVEEVERSION }}

- name: Extract release tag
if: ${{ steps.find-release.outputs.data }}
- name: Set RealEeveeVersion if tag provided
if: ${{ env.EEVEEVERSION != '' }}
id: fetch-tags
run: |
RELEASES=$(echo "${{ steps.find-release.outputs.data }}" | jq -r '.[].tag_name')
for tag in $RELEASES; do
if [[ $tag == *"${EEVEEVERSION}"* ]]; then
export REALEEVEEVERSION=$tag
break
EEVEEVERSION="${{ env.EEVEEVERSION }}"
# Fetch all tags from the repository
tags=$(curl -s https://api.github.com/repos/whoeevee/EeveeSpotify/tags | jq -r '.[].name')
# Find the tag that contains the EEVEEVERSION value
for tag in $tags; do
if [[ $tag == *"$EEVEEVERSION"* ]]; then
echo "REALEEVEEVERSION=$tag" >> $GITHUB_ENV
exit 0
fi
done
echo "REALEEVEEVERSION=$REALEEVEEVERSION" >> $GITHUB_ENV
# If no matching tag is found, fail the job
echo "No matching tag found for EEVEEVERSION=$EEVEEVERSION"
exit 1
- name: Create Build Components folder
run: mkdir -p "Build Components"
Expand Down

0 comments on commit c8eb49e

Please sign in to comment.