diff --git a/util/generate-latest-docs.sh b/util/generate-latest-docs.sh index 7b1b35efca7..78f28efd320 100755 --- a/util/generate-latest-docs.sh +++ b/util/generate-latest-docs.sh @@ -44,7 +44,9 @@ cd $GH_PAGES_DIR git add --all . git config --global user.name "$GITHUB_ACTOR" git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" -git commit -m "Latest docs on successful build $GITHUB_RUN_NUMBER auto-pushed to gh-pages" -git push -fq origin gh-pages > /dev/null - -echo -e "Published docs to gh-pages.\n" +if git commit -m "Latest docs on successful build $GITHUB_RUN_NUMBER auto-pushed to gh-pages"; then + git push -fq origin gh-pages > /dev/null + echo -e "Published docs to gh-pages.\n" +else + echo -e "No doc changes to publish.\n" +fi