From 8a455aaaf8248a913b3b0fedfa4e9a85dfbcbdd1 Mon Sep 17 00:00:00 2001 From: Christopher Warrington Date: Thu, 18 Mar 2021 11:17:12 -0700 Subject: [PATCH] [doc] Do not fail build when there are no changes During the doc build, if there are no changes, `git commit` [exits with 1 and the build fails][1]. Don't test exit code of `git commit`. The subsequent `git push` will exit with 0 even if there is nothing to do, so subsequent tests will see a $LASTEXITCODE of 0. [1]: https://ci.appveyor.com/project/MicrosoftBond/bond/branch/master/job/j8ujo6s6pb59an50 --- appveyor.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d109aed45..20ac09884 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -310,9 +310,12 @@ if ($LASTEXITCODE -ne 0) { throw "git add failed: $LASTEXITCODE" } - git commit -m "Update documentation" + # Don't test exit code of 'git commit'. When there is + # nothing to commit, it exits with 1. The push below + # should still exit with 0 after not doing anything, so + # the build will still pass. - if ($LASTEXITCODE -ne 0) { throw "git commit failed: $LASTEXITCODE" } + git commit -m "Update documentation" git push origin gh-pages 2>&1 | out-null