Skip to content

Commit

Permalink
fix(scripts): always return the latest tag in version.sh (#379)
Browse files Browse the repository at this point in the history
(cherry picked from commit 46c97a4)
  • Loading branch information
mafredri committed Oct 2, 2024
1 parent 0ec371f commit 3759642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ if [[ -z ${tag_list} ]]; then
else
current_commit=$(git rev-parse HEAD)
# Try to find the last tag that contains the current commit
last_tag=$(git tag --contains "$current_commit" --sort=version:refname | head -n 1)
last_tag=$(git tag --contains "$current_commit" --sort=-version:refname | head -n 1)
# If there is no tag that contains the current commit,
# get the latest tag sorted by semver.
if [[ -z "${last_tag}" ]]; then
last_tag=$(git tag --sort=version:refname | tail -n 1)
last_tag=$(git tag --sort=-version:refname | head -n 1)
fi
fi

Expand Down

0 comments on commit 3759642

Please sign in to comment.