File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,15 @@ if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]
35
35
set +e
36
36
git add .
37
37
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
42
49
fi
You can’t perform that action at this time.
0 commit comments