Skip to content

Commit 85f8688

Browse files
DirectXMan12frozencemetery
authored andcommitted
[infra] exit succesfully when no docs changes
This detects when no docs changes are present in the docs deployer script, and exits with code 0 instead of code 1, so the deploy is treated as successful. Fixes: #136
1 parent b141894 commit 85f8688

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.travis/docs-deploy.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -ex
22

33
# NB (very important): BE VERY CAREFUL WITH `set -x` FOR THIS FILE.
4-
# The GitHub token is sensative information, and should never
4+
# The GitHub token is sensitive information, and should never
55
# be displayed on in the clear.
66

77
source_directory=${1?need <source dir> <target dir> <target repo> [<target branch, default: gh-pages>]}
@@ -24,6 +24,12 @@ echo $desc > ${scratch_dir}/docs/${target_directory}/.from
2424
pushd $scratch_dir/docs
2525
git config user.email "[email protected]"
2626
git config user.name "Deployment Bot (from Travis CI)"
27+
28+
if [[ $(git status --porcelain | wc -l) -eq 0 ]]; then
29+
echo "no docs changes in the latest commit"
30+
exit 0
31+
fi
32+
2733
git add ${target_directory}
2834
git commit -m "Update ${target_directory} docs in based on ${desc}"
2935

0 commit comments

Comments
 (0)