Skip to content

Commit 6e8364c

Browse files
committed
Make pre-push hook interactive rather than blocking
1 parent ffbda62 commit 6e8364c

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

scripts/git-hooks/pre-push

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22
#ddev-generated
33

44
# ── Sanity check ─────────────────────────────────────────────────────────────
5+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
56
ddev sanity-check
67
if [[ $? -ne 0 ]]; then
78
echo ""
8-
echo "🚫 Push aborted: sanity-check failed. Fix the issues above or use --no-verify to push anyway."
9-
exit 1
9+
if [[ "$CURRENT_BRANCH" == "dev" ]]; then
10+
echo "⚠️ Sanity-check failed on 'dev' branch — pushing anyway."
11+
else
12+
read -p "⚠️ Sanity-check failed. Continue pushing anyway? (y/N): " sanity_confirm </dev/tty
13+
sanity_confirm=${sanity_confirm:-N}
14+
if [[ ! "$sanity_confirm" =~ ^[Yy] ]]; then
15+
echo "🚫 Push aborted: fix the issues above and try again."
16+
exit 1
17+
fi
18+
fi
1019
fi
1120

1221
# ── Backstop tests check ────────────────────────────────────────────────────

0 commit comments

Comments
 (0)