mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 07:23:00 +00:00
build.sh: only deploy commits present on the main branch
This commit is contained in:
parent
4a40e78dd7
commit
889ccf3acc
1 changed files with 4 additions and 4 deletions
8
build.sh
8
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
|
||||
|
||||
# ██████ ██ ██████ ██ ██ ██ ██ ██████
|
||||
|
|
Loading…
Reference in a new issue