diff --git a/.gitea/scripts/add-annotations.sh b/.gitea/scripts/add-annotations.sh index c25f51a..6521911 100755 --- a/.gitea/scripts/add-annotations.sh +++ b/.gitea/scripts/add-annotations.sh @@ -8,8 +8,8 @@ if [ ! -f "${CHART_FILE}" ]; then exit 1 fi -DEFAULT_NEW_TAG="$(git describe --abbrev=0)" -DEFAULT_OLD_TAG="$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")" +DEFAULT_NEW_TAG="$(git tag --sort=-version:refname | head -n 1)" +DEFAULT_OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" if [ -z "${1}" ]; then read -p "Enter start tag [${DEFAULT_OLD_TAG}]: " OLD_TAG diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index c04c5ab..05782c4 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -26,8 +26,8 @@ jobs: run: | git tag - NEW_TAG="$(git describe --abbrev=0)" - OLD_TAG="$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")" + NEW_TAG="$(git tag --sort=-version:refname | head -n 1)" + OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" .gitea/scripts/add-annotations.sh "${OLD_TAG}" "${NEW_TAG}"