Skip to content

Commit

Permalink
fix(build): execute git commit only if there have been changes
Browse files Browse the repository at this point in the history
  • Loading branch information
silvolu committed Oct 31, 2014
1 parent 2ffcc3b commit a067dab
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]
set +e
git add .
set -e
# commit to gh-pages branch to apply changes
git config user.name "selfiebot"
git commit -m "Update docs after merge to master"
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages
git status
# H/T: https://github.com/dhermes
if [[ -n "$(git status --porcelain)" ]]; then
# commit to gh-pages branch to apply changes
git config user.name "selfiebot"
git commit -m "Update docs after merge to master"
git status
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages
else
echo "Nothing to commit. Exiting without pushing changes."
fi
fi

0 comments on commit a067dab

Please sign in to comment.