From 4b7fe528fdc98a24452f9ff42366ea3b3ac9f1e7 Mon Sep 17 00:00:00 2001 From: actionless Date: Mon, 10 Aug 2020 04:55:53 +0200 Subject: [PATCH] fix(travis): clean-up unusable push to github.io repo for prs --- .travis.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61118a6..0106591 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,23 +44,11 @@ addons: # working copy to be there for updating already. before_install: - | - if [ -n "$GH_APIDOC_TOKEN" ]; then + if [ -n "$GH_APIDOC_TOKEN" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] ; then set -e git clone \ https://${GH_APIDOC_TOKEN}@github.com/awesomeWM/awesomeWM.github.io \ "$BUILD_WEB" 2>&1 | sed "s/$GH_APIDOC_TOKEN/GH_APIDOC_TOKEN/g" - if [ "$TRAVIS_PULL_REQUEST" = false ]; then - branch="$TRAVIS_BRANCH" - else - branch="pr-$TRAVIS_PULL_REQUEST" - fi - if [ "$branch" != master ]; then - cd $BUILD_WEB - if ! git checkout -b "$branch" "origin/$branch"; then - git checkout -b "$branch" - fi - cd - - fi fi install: @@ -87,8 +75,7 @@ script: after_success: - | - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi - if [ -n "$GH_APIDOC_TOKEN" ]; then + if [ -n "$GH_APIDOC_TOKEN" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] ; then set -e commit_hash=$(git rev-parse --short HEAD) cd $BUILD_WEB