Skip to content

Commit

Permalink
Change to work when no releases have been made yet
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenperera committed Sep 25, 2023
1 parent f9a8a91 commit eb0c51b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,16 @@ jobs:
shell: bash
run: |
RELEASE_VERSION=$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml)
OLD_VERSION=$(curl "https://api.github.com/repos/ThePrimeagen/htmx-lsp/releases/latest" | grep "tag_name" | cut -d'"' -f4)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
latest=$(curl https://api.github.com/repos/ThePrimeagen/htmx-lsp/releases/latest)
# no releases, default to 0.0.0
if [[ "$latest" == *"Not Found"* ]]; then
OLD_VERSION="0.0.0"
else
OLD_VERSION=$( echo $latest | grep "tag_name" | cut -d'"' -f4 )
fi
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "$OLD_VERSION -> $RELEASE_VERSION"
if [[ "$RELEASE_VERSION" == "$OLD_VERSION" ]]; then
Expand Down

0 comments on commit eb0c51b

Please sign in to comment.