File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,15 @@ if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]
3535 set +e
3636 git add .
3737 set -e
38- # commit to gh-pages branch to apply changes
39- git config user.name " selfiebot"
40- git commit -m " Update docs after merge to master"
41- git push https://${GH_OAUTH_TOKEN} @github.com/${GH_OWNER} /${GH_PROJECT_NAME} HEAD:gh-pages
38+ git status
39+ # H/T: https://github.com/dhermes
40+ if [[ -n " $( git status --porcelain) " ]]; then
41+ # commit to gh-pages branch to apply changes
42+ git config user.name " selfiebot"
43+ git commit -m " Update docs after merge to master"
44+ git status
45+ git push https://${GH_OAUTH_TOKEN} @github.com/${GH_OWNER} /${GH_PROJECT_NAME} HEAD:gh-pages
46+ else
47+ echo " Nothing to commit. Exiting without pushing changes."
48+ fi
4249fi
You can’t perform that action at this time.
0 commit comments