Skip to content

Commit

Permalink
Get latest Git tag by semver instead of chronological order (#8881)
Browse files Browse the repository at this point in the history
Co-authored-by: Abhay Krishna Arunachalam <[email protected]>
  • Loading branch information
eks-distro-pr-bot and abhay-krishna authored Oct 21, 2024
1 parent 49f40aa commit 95dbb38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/eksa_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function eksa-version::get_next_eksa_version_for_ancestor() {
minor_release=$(echo $ancestor_branch | grep -Eo "[[:digit:]]+.[[:digit:]]+")
latest_tag=$(git tag -l "v${minor_release}.*" | sort -V | tail -n 1)
if [[ -z "$latest_tag" ]]; then
latest_tag=$(git describe --tags "$(git rev-list --tags='v*.*.*' --max-count=1)")
latest_tag=$(git describe --tags "$(git tag -l "v*" --sort -v:refname | head -1)")
release_version=$(echo "${latest_tag}" | awk -F. -v OFS=. '{$2++; $3=0; print}')
else
release_version=$(echo "${latest_tag}" | awk -F. -v OFS=. '{$3++; print}')
Expand Down

0 comments on commit 95dbb38

Please sign in to comment.