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