Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] exit succesfully when no docs changes #145

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .travis/docs-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -ex

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

source_directory=${1?need <source dir> <target dir> <target repo> [<target branch, default: gh-pages>]}
Expand All @@ -24,6 +24,12 @@ echo $desc > ${scratch_dir}/docs/${target_directory}/.from
pushd $scratch_dir/docs
git config user.email "deploy@travis-ci.org"
git config user.name "Deployment Bot (from Travis CI)"

if [[ $(git status --porcelain | wc -l) -eq 0 ]]; then
echo "no docs changes in the latest commit"
exit 0
fi

git add ${target_directory}
git commit -m "Update ${target_directory} docs in based on ${desc}"

Expand Down