From 22c404b320c0ba6d4445ec4d695e4d9cb43b5a11 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 21 Jul 2021 02:29:05 +0100 Subject: [PATCH] build.sh: only do ci tasks on main branch --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index ea083f7..3c6be47 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash set -e; +current_branch="$(git rev-parse --abbrev-ref HEAD)"; + +if [[ "${1}" == "ci" ]] && [[ "${current_branch}" != "main" ]]; then + echo "Skipping build, because we are currently on the branch '${current_branch}', and we only deploy on the 'main' branch."; +fi + # ██████ ██ ██████ ██ ██ ██ ██ ██████ # ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ # ██ ██ ██████ ██ ██ ██ ██ ██ ██