Skip to content

Commit d50f09d

Browse files
kiyeonjeon21claude
andcommitted
fix: sync pre-push script with hook fix for post-bump commits
The .git/hooks/pre-push was fixed earlier to detect feat/fix commits after a bump commit, but the source script in scripts/ wasn't updated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent df55ea8 commit d50f09d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

scripts/pre-push-version-bump.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ if [ -z "$COMMITS" ]; then
2727
exit 0
2828
fi
2929

30-
# Check if there's already a version bump commit (avoid double-bump)
31-
if echo "$COMMITS" | grep -q "^chore: bump version to"; then
30+
# Check if the latest commit is already a version bump (avoid double-bump on re-push)
31+
LATEST_COMMIT=$(git log -1 --pretty=format:"%s")
32+
if echo "$LATEST_COMMIT" | grep -q "^chore: bump version to"; then
3233
exit 0
3334
fi
3435

35-
# Determine bump type from commit messages
36+
# Determine bump type from commits AFTER the last bump (not all commits since tag)
3637
BUMP=""
38+
FOUND_BUMP=false
3739
while IFS= read -r msg; do
40+
if echo "$msg" | grep -q "^chore: bump version to"; then
41+
FOUND_BUMP=true
42+
break
43+
fi
3844
case "$msg" in
3945
feat:*|feat\(*) BUMP="minor"; break ;;
4046
fix:*|fix\(*) [ -z "$BUMP" ] && BUMP="patch" ;;

0 commit comments

Comments
 (0)