From 7abfdf2c44cd3e8f6c481ff83caee2bfabc79dcc Mon Sep 17 00:00:00 2001 From: luttje <2738114+luttje@users.noreply.github.com> Date: Sun, 1 Dec 2024 19:20:02 +0100 Subject: [PATCH] Explicitly load tags from shallow gh clone --- .github/workflows/publish_version.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_version.yml b/.github/workflows/publish_version.yml index 65a3c05..59a3fd2 100644 --- a/.github/workflows/publish_version.yml +++ b/.github/workflows/publish_version.yml @@ -126,7 +126,17 @@ jobs: - name: Store the latest tag in a variable id: get_tag - run: echo "LATEST_TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT + run: | + latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) + echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV + echo "Latest tag is $LATEST_TAG" + + - name: Fail if no tag is found + run: | + if [ -z "$LATEST_TAG" ]; then + echo "Failed: No latest tag found" + exit 1 + fi - name: Create a new release id: create_release