From 42642c94c3bb568aec49eb82d507218e77d71ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Mon, 14 Oct 2019 23:10:42 +0200 Subject: [PATCH] Only push on 'main' branch --- hooks/push | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hooks/push b/hooks/push index 0c0b65f..c1e3ccb 100755 --- a/hooks/push +++ b/hooks/push @@ -2,4 +2,13 @@ . hooks/common -run_build --push-only +if [ "${SOURCE_BRANCH}" == "main" ] || [ "${DEBUG}" == "true" ]; then + if [ "${SOURCE_BRANCH}" != "main" ]; then + echo "⚠️⚠️⚠️ Would exit, but DEBUG is '${DEBUG}'". + fi + + run_build --push-only +else + echo "⚠️⚠️⚠️ Only pushing on 'main' branch, but current branch is '${SOURCE_BRANCH}'" + exit 0 +fi