Skip to content

Commit fd35873

Browse files
committed
fix: improve tag detection
1 parent 3f1eed6 commit fd35873

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ jobs:
3434
# Check last tag and commits to determine bump
3535
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
3636
if [ -z "$LAST_TAG" ]; then
37-
# No previous tags - check all commits on main
38-
FEAT_COUNT=$(git log --all --oneline | grep -c "^feat:" || echo "0")
39-
FIX_COUNT=$(git log --all --oneline | grep -c "^fix:" || echo "0")
37+
# No previous tags - check commits on main
38+
FEAT_COUNT=$(git log origin/main --oneline | grep -c "^feat:" || echo "0")
39+
FIX_COUNT=$(git log origin/main --oneline | grep -c "^fix:" || echo "0")
4040
else
41-
FEAT_COUNT=$(git log --pretty=format:"%s" $LAST_TAG..HEAD --ancestry-path | grep -c "^feat:" || echo "0")
42-
FIX_COUNT=$(git log --pretty=format:"%s" $LAST_TAG..HEAD --ancestry-path | grep -c "^fix:" || echo "0")
41+
# Check commits since last tag
42+
FEAT_COUNT=$(git log $LAST_TAG..origin/main --oneline | grep -c "^feat:" || echo "0")
43+
FIX_COUNT=$(git log $LAST_TAG..origin/main --oneline | grep -c "^fix:" || echo "0")
4344
fi
4445
FEAT_COUNT=$(echo "$FEAT_COUNT" | tr -d '[:space:]')
4546
FIX_COUNT=$(echo "$FIX_COUNT" | tr -d '[:space:]')
47+
echo "FEAT_COUNT=$FEAT_COUNT FIX_COUNT=$FIX_COUNT LAST_TAG=$LAST_TAG"
4648
if [ "${FEAT_COUNT:-0}" -gt 0 ]; then
4749
BUMP="minor"
4850
elif [ "${FIX_COUNT:-0}" -gt 0 ]; then

0 commit comments

Comments
 (0)