From 37a9d02850aa2437b86743d2a20065d39abab180 Mon Sep 17 00:00:00 2001 From: Christian Legnitto Date: Fri, 3 May 2019 00:39:33 -0700 Subject: [PATCH] Fix failure when no book content has changed If there is no new book content, `git commit` will return `1` and the entire job will error. Took answer from https://stackoverflow.com/questions/8123674/how-to-git-commit-nothing-without-an-error --- docs/book/ci-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/ci-build.sh b/docs/book/ci-build.sh index f93755a3..3b00bb4e 100755 --- a/docs/book/ci-build.sh +++ b/docs/book/ci-build.sh @@ -48,5 +48,5 @@ git remote set-url --push origin git@github.com:graphql-rust/juniper.git git config --local user.name "Juniper Bot" git config --local user.email "juniper@example.com" git add -A $VERSION -git commit -m "Updated book for $VERSION ***NO_CI***" +git diff-index --quiet HEAD || git commit -m "Updated book for $VERSION ***NO_CI***" git push origin gh-pages