Added a better way to get the last tag

This commit is contained in:
2024-12-25 19:12:23 +01:00
parent 064bd6b373
commit e1856518be

View File

@@ -13,7 +13,8 @@ runs:
else else
log_info "This is a branch push: $(yellow)${GITHUB_REF##refs/heads/}" log_info "This is a branch push: $(yellow)${GITHUB_REF##refs/heads/}"
last_version="$(git describe --tags --match "v*" --abbrev=0 || echo "")" git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname'
last_version="$(git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname' | head -n 1 | cut -d "/" -f3 || echo "")"
if [[ -z "$last_version" ]]; then if [[ -z "$last_version" ]]; then
last_version="v0.0.0" last_version="v0.0.0"
fi fi