Skip to content

Commit

Permalink
release.sh: skip if nothing to commit for gh-pages (#2851)
Browse files Browse the repository at this point in the history
Motivation:

Sometimes it's required to re-run the release script if there was an
error with a previous build. In this case, gh-pages are already
generated and the 2nd run does not produce any new output. Script fails
with "nothing to commit" message.

Modifications:

- Commit gh-pages only if there is a non-empty diff;

Result:

release.sh script does not fail if there are no updates for gh-pages.
  • Loading branch information
idelpivnitskiy authored Feb 22, 2024
1 parent 2e47396 commit af2f9e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ fi
echo $files_to_revert | xargs git checkout --

$git add * .nojekyll
$git commit --author="$GIT_AUTHOR" -m "Publish docs website $version_majorminor"
$git diff-index --quiet HEAD || $git commit --author="$GIT_AUTHOR" -m "Publish docs website $version_majorminor"
$git push docs gh-pages
popd

Expand Down

0 comments on commit af2f9e7

Please sign in to comment.