Skip to content

Commit

Permalink
[doc] Do not fail build when there are no changes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chwarr authored Mar 18, 2021
1 parent bdc07dd commit 8a455aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a455aa

Please sign in to comment.