From 5dd675d07fd3c8877571ebb4434765e831302f09 Mon Sep 17 00:00:00 2001 From: Bill Seremetis Date: Mon, 23 Mar 2026 10:13:21 +0200 Subject: [PATCH] pre-push verification when pushing directly to production --- scripts/git-hooks/pre-push | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/scripts/git-hooks/pre-push b/scripts/git-hooks/pre-push index ce2f37f..58cb2bc 100755 --- a/scripts/git-hooks/pre-push +++ b/scripts/git-hooks/pre-push @@ -59,4 +59,46 @@ if [ -f "tests/backstop/backstop.json" ] && [[ "$CURRENT_BRANCH" != "dev" ]]; th fi fi +# ── Main/master branch protection ─────────────────────────────────────────── +if [[ "$CURRENT_BRANCH" == "main" || "$CURRENT_BRANCH" == "master" ]]; then + echo "" + echo "==================================================================================================" + echo "⚠️ You are about to push directly to '$CURRENT_BRANCH'." + echo "==================================================================================================" + echo "" + read -p "Are you sure you want to push to '$CURRENT_BRANCH'? (type 'yes' to confirm): " main_confirm