|
23 | 23 |
|
24 | 24 | # Get the range of commits being pushed |
25 | 25 | # 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 |
27 | 27 | REMOTE_REF="origin/$LOCAL_BRANCH" |
28 | 28 | 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" |
31 | 32 | else |
32 | 33 | # No remote branch yet, compare with base branch |
33 | 34 | COMMIT_RANGE="origin/$BASE_BRANCH..HEAD" |
@@ -109,27 +110,27 @@ PR_URL="https://github.com/$REPO/compare/$BASE_BRANCH...$LOCAL_BRANCH" |
109 | 110 | # Display appropriate message (this will show before push, but is informational) |
110 | 111 | if [ "$FOUND_RELEASE" = true ]; then |
111 | 112 | 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" |
113 | 114 | echo "" |
114 | 115 | echo "💡 Open a PR with the Course Release Template:" |
115 | 116 | echo "" |
116 | 117 | echo " $PR_URL?template=course_release.md" |
117 | 118 | echo "" |
118 | | -elif [ "$FOUND_FIX" = true ]; then |
| 119 | +elif [ "$FOUND_DRAFT" = true ]; then |
119 | 120 | echo "" |
120 | | - echo "🔧 Course fix detected (course already has :status: active)!" |
| 121 | + echo "📝 Course draft(s) detected" |
121 | 122 | echo "" |
122 | | - echo "💡 Open a PR with the Course Fix Template:" |
| 123 | + echo "💡 Open a PR with the Course Draft Template:" |
123 | 124 | echo "" |
124 | | - echo " $PR_URL?template=course_fix.md" |
| 125 | + echo " $PR_URL?template=course_draft.md" |
125 | 126 | echo "" |
126 | | -elif [ "$FOUND_DRAFT" = true ]; then |
| 127 | +elif [ "$FOUND_FIX" = true ]; then |
127 | 128 | echo "" |
128 | | - echo "📝 Course draft(s) detected!" |
| 129 | + echo "🔧 Course fix detected" |
129 | 130 | echo "" |
130 | | - echo "💡 Open a PR with the Course Draft Template:" |
| 131 | + echo "💡 Open a PR with the Course Fix Template:" |
131 | 132 | echo "" |
132 | | - echo " $PR_URL?template=course_draft.md" |
| 133 | + echo " $PR_URL?template=course_fix.md" |
133 | 134 | echo "" |
134 | 135 | fi |
135 | 136 |
|
|
0 commit comments