diff --git a/build.sh b/build.sh index c92e7a9..17809ff 100755 --- a/build.sh +++ b/build.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash set -e; -current_branch="$(git rev-parse --abbrev-ref HEAD)"; +# current_branch="$(git rev-parse --abbrev-ref HEAD)"; +is_main="$(git branch --contains HEAD | awk '/HEAD/ { next } /main/ { print $1 }')"; -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."; - exit 0; +if [[ "${1}" == "ci" ]] && [[ ! -z "${is_main}" ]]; then + echo "Skipping build, because this commit does not appear to be on the 'main' branch, and we only deploy commits on the 'main' branch."; fi # ██████ ██ ██████ ██ ██ ██ ██ ██████