diff --git a/entrypoint.sh b/entrypoint.sh index 0dafb7c6..e36fb44e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -45,9 +45,10 @@ REPOSITORY_PATH="https://${ACCESS_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" && # Checks to see if the remote exists prior to deploying. # If the branch doesn't exist it gets created here as an orphan. -if [ `git ls-remote --heads $REPOSITORY_PATH $BRANCH | wc -l` ] +if [ `git ls-remote --heads $REPOSITORY_PATH $BRANCH | wc -l` = false ] then echo "Creating remote branch ${BRANCH} as it doesn't exist..." + git checkout "${BASE_BRANCH:-master}" && \ git checkout --orphan $BRANCH && \ git rm -rf . && \ touch README.md && \