Added a better way to get the last tag

This commit is contained in:
2024-12-25 19:12:46 +01:00
parent f8c01ecf12
commit ffcc57549f

View File

@@ -19,11 +19,9 @@ runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Include full history with tags
- name: Get new version
run: |
last_version="$(git describe --tags --match "v*" --abbrev=0 || echo "")"
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
last_version="v0.0.0"
fi