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