Skip to content

Commit 82ce4c9

Browse files
committed
fix: align verify script with README merge strategy
The verify script was checking for rebase-only configuration while the README recommends merge-commits-only. This inconsistency caused confusion when the script reported failures for correctly configured repositories. Changes: - Check for merge commits enabled (not rebase) - Check for rebase disabled (not enabled) - Update info messages to reflect merge-commits-only strategy - Add comment explaining the rationale (merge commits preserve history, strict branch protection ensures rebased PRs)
1 parent 5c1ca96 commit 82ce4c9

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

scripts/verify-github-project.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,12 @@ if command -v gh &> /dev/null && [ -n "$REPO_SLUG" ]; then
247247
esac
248248
fi
249249

250-
# Check for rebase-only configuration (recommended)
251-
if [ "$ALLOW_REBASE" = "true" ] && [ "$ALLOW_MERGE" = "false" ] && [ "$ALLOW_SQUASH" = "false" ]; then
252-
pass "Repo configured for rebase-only merges (recommended)"
253-
elif [ "$ALLOW_REBASE" = "true" ]; then
254-
info "Multiple merge methods allowed. Consider enabling rebase-only for clean history."
250+
# Check for merge-commit-only configuration (recommended)
251+
# Merge commits preserve complete history while strict branch protection ensures PRs are rebased before merge
252+
if [ "$ALLOW_MERGE" = "true" ] && [ "$ALLOW_REBASE" = "false" ] && [ "$ALLOW_SQUASH" = "false" ]; then
253+
pass "Repo configured for merge-commits-only (recommended)"
254+
elif [ "$ALLOW_MERGE" = "true" ]; then
255+
info "Multiple merge methods allowed. Consider enabling merge-commits-only for clean history with visible PR integration points."
255256
fi
256257
fi
257258
else
@@ -373,22 +374,22 @@ if command -v gh &> /dev/null && [ -n "$REPO_SLUG" ]; then
373374
ALLOW_SQUASH=$(echo "$REPO_SETTINGS" | jq -r '.allow_squash_merge // true')
374375
DELETE_ON_MERGE=$(echo "$REPO_SETTINGS" | jq -r '.delete_branch_on_merge // false')
375376

376-
if [ "$ALLOW_REBASE" = "true" ]; then
377-
pass "Rebase merge enabled"
377+
if [ "$ALLOW_MERGE" = "true" ]; then
378+
pass "Merge commits enabled"
378379
else
379-
fail "Rebase merge disabled (should be enabled)"
380+
fail "Merge commits disabled (should be enabled)"
380381
fi
381382

382-
if [ "$ALLOW_MERGE" = "false" ]; then
383-
pass "Merge commits disabled"
383+
if [ "$ALLOW_REBASE" = "false" ]; then
384+
pass "Rebase merge disabled"
384385
else
385-
fail "Merge commits enabled (should be disabled - rebase only)"
386+
fail "Rebase merge enabled (should be disabled - merge commits only)"
386387
fi
387388

388389
if [ "$ALLOW_SQUASH" = "false" ]; then
389390
pass "Squash merge disabled"
390391
else
391-
fail "Squash merge enabled (should be disabled - rebase only)"
392+
fail "Squash merge enabled (should be disabled - merge commits only)"
392393
fi
393394

394395
if [ "$DELETE_ON_MERGE" = "true" ]; then
@@ -416,7 +417,7 @@ echo " - Require review from CODEOWNERS"
416417
echo " - Require conversation resolution"
417418
echo " - Do not allow force pushes"
418419
echo " - Do not allow deletions"
419-
echo " - Allow rebase merge only (disable merge & squash)"
420+
echo " - Allow merge commits only (disable rebase & squash)"
420421
echo " - Delete branch on merge"
421422
info "Check with: gh api repos/{owner}/{repo}/branches/main/protection"
422423

0 commit comments

Comments
 (0)