fix: tag bump on tagless repo by walking full HEAD range
Auto Tag / tag (push) Successful in 2s
CI / validate (push) Failing after 3s
Auto Tag / release (push) Successful in 22s

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) <noreply@anthropic.com>
This commit is contained in:
2026-05-01 13:50:16 +02:00
parent c0a2372135
commit 3545abfa36
+7 -2
View File
@@ -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