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) <noreply@anthropic.com>
This commit is contained in:
@@ -20,10 +20,15 @@ jobs:
|
|||||||
- name: Determine version bump and create tag
|
- name: Determine version bump and create tag
|
||||||
id: bump
|
id: bump
|
||||||
run: |
|
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"
|
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
|
if [ -z "$COMMITS" ]; then
|
||||||
echo "No new commits since ${LATEST_TAG}, skipping."
|
echo "No new commits since ${LATEST_TAG}, skipping."
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user