From 3545abfa363a127dd26a54e392f2cce857f00d4b Mon Sep 17 00:00:00 2001 From: Tomas Uvira Date: Fri, 1 May 2026 13:50:16 +0200 Subject: [PATCH] fix: tag bump on tagless repo by walking full HEAD range git describe falls back to literal "v0.0.0" when no tags exist; the subsequent git log v0.0.0..HEAD then fails silently and the workflow skips, so the very first feat: commit never produces a tag. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/auto-tag.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/auto-tag.yml b/.gitea/workflows/auto-tag.yml index 1881e42..3a71ab6 100644 --- a/.gitea/workflows/auto-tag.yml +++ b/.gitea/workflows/auto-tag.yml @@ -20,10 +20,15 @@ jobs: - name: Determine version bump and create tag id: bump run: | - LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") + if LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null); then + RANGE="${LATEST_TAG}..HEAD" + else + LATEST_TAG="v0.0.0" + RANGE="HEAD" + fi echo "Latest tag: $LATEST_TAG" - COMMITS=$(git log "${LATEST_TAG}..HEAD" --pretty=format:"%s" 2>/dev/null) + COMMITS=$(git log "$RANGE" --pretty=format:"%s") if [ -z "$COMMITS" ]; then echo "No new commits since ${LATEST_TAG}, skipping." exit 0