Skip to content

Commit 07109de

Browse files
committed
Update pre-push
1 parent b78e07b commit 07109de

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.husky/pre-push

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ fi
2323

2424
# Get the range of commits being pushed
2525
# Pre-push hook receives: $1 = remote name, $2 = remote URL
26-
# We can also check what commits are being pushed
26+
# For testing and PR purposes, always compare against base branch to see what would be in the PR
2727
REMOTE_REF="origin/$LOCAL_BRANCH"
2828
if git rev-parse --verify "$REMOTE_REF" >/dev/null 2>&1; then
29-
# Remote branch exists, compare with it
30-
COMMIT_RANGE="$REMOTE_REF..HEAD"
29+
# Remote branch exists, compare what's new (not yet on remote) with base
30+
# This shows what would be in the PR
31+
COMMIT_RANGE="origin/$BASE_BRANCH..HEAD"
3132
else
3233
# No remote branch yet, compare with base branch
3334
COMMIT_RANGE="origin/$BASE_BRANCH..HEAD"
@@ -109,27 +110,27 @@ PR_URL="https://github.com/$REPO/compare/$BASE_BRANCH...$LOCAL_BRANCH"
109110
# Display appropriate message (this will show before push, but is informational)
110111
if [ "$FOUND_RELEASE" = true ]; then
111112
echo ""
112-
echo "✅ Course(s) with :status: active added - this looks like a release!"
113+
echo "✅ Course(s) updated with :status: active added - this looks like a release"
113114
echo ""
114115
echo "💡 Open a PR with the Course Release Template:"
115116
echo ""
116117
echo " $PR_URL?template=course_release.md"
117118
echo ""
118-
elif [ "$FOUND_FIX" = true ]; then
119+
elif [ "$FOUND_DRAFT" = true ]; then
119120
echo ""
120-
echo "🔧 Course fix detected (course already has :status: active)!"
121+
echo "📝 Course draft(s) detected"
121122
echo ""
122-
echo "💡 Open a PR with the Course Fix Template:"
123+
echo "💡 Open a PR with the Course Draft Template:"
123124
echo ""
124-
echo " $PR_URL?template=course_fix.md"
125+
echo " $PR_URL?template=course_draft.md"
125126
echo ""
126-
elif [ "$FOUND_DRAFT" = true ]; then
127+
elif [ "$FOUND_FIX" = true ]; then
127128
echo ""
128-
echo "📝 Course draft(s) detected!"
129+
echo "🔧 Course fix detected"
129130
echo ""
130-
echo "💡 Open a PR with the Course Draft Template:"
131+
echo "💡 Open a PR with the Course Fix Template:"
131132
echo ""
132-
echo " $PR_URL?template=course_draft.md"
133+
echo " $PR_URL?template=course_fix.md"
133134
echo ""
134135
fi
135136

0 commit comments

Comments
 (0)