Only try to push if it is not a PR

This commit is contained in:
probonopd authored and GitHub committed 2017-08-12 17:54:57 +02:00
1 parent bf42e982f7
commit c1d37a8a67
1 file changed
+15 -9
+15 -9
View File
@@ -3,6 +3,10 @@
URL=$(cat $1 | head -n 1)
echo $URL
if [ "$TRAVIS_PULL_REQUEST" == "false" ] ; then
git checkout master
fi
INPUTBASENAME=$(basename $1)
# Check if $URL starts with "http", otherwise exit
@@ -209,15 +213,17 @@ echo "==========================================="
# If this is not a PR, then git add the "database file" and git commit with "[ci skip]" and git push
# https://gist.github.com/willprice/e07efd73fb7f13f917ea
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
( cd database/ ; git add . || true ) # Recursively add everything in this directory
git commit -F- <<EOF || true # Always succeeed (even if there was nothing to add)
Add automatically parsed data ($TRAVIS_BUILD_NUMBER)
[ci skip]
EOF
git remote add deploy https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
git push --set-upstream deploy
if [ "$TRAVIS_PULL_REQUEST" == "false" ] ; then
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI"
( cd database/ ; git add . || true ) # Recursively add everything in this directory
git commit -F- <<EOF || true # Always succeeed (even if there was nothing to add)
Add automatically parsed data ($TRAVIS_BUILD_NUMBER)
[ci skip]
EOF
git remote add deploy https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
git push --set-upstream deploy
fi
# TODO: If this is not a PR, then convert the "database files" into whatever output formats we need to support
# e.g., OCS for knsrc/Discover