Skip to content

Commit

Permalink
grab the latest release by version
Browse files Browse the repository at this point in the history
  • Loading branch information
MattEdwardsWaggleBee committed Jun 21, 2024
1 parent 414deb7 commit 256a80b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ jobs:
id: get_version_suffix
shell: bash
run: |
release_info=$(gh release view $version) || exit 1
version_suffix=${release_info#*$version}
# Fetch the list of releases
releases=$(gh release list --json createdAt,tagName --limit 100)
# Filter the releases based on the starting version number, sort them by date, and extract the most recent one
latest_release=$(echo "$releases" | jq -r --arg version "$version" 'map(select(.tagName | startswith($version))) | sort_by(.createdAt) | reverse | .[0] | .tagName')
version_suffix=${latest_release#*$version}
echo "VERSION_SUFFIX=$version_suffix" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 256a80b

Please sign in to comment.