From a8c899cbc273316b6f1a5fb50e61aab5d67d1d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20Mari=C8=99?= Date: Mon, 8 May 2017 19:50:25 +0300 Subject: [PATCH] Trigger docs update only for changes in `master` See also: https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables --- .gitattributes | 1 - .travis/check-links.sh | 14 ++++++++------ .travis/trigger-site-docs-build.sh | 13 ++++++++++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.gitattributes b/.gitattributes index 86b7cbb3655..a35cbada8f2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,7 +3,6 @@ * text=auto - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Exclude the following files from GitHub's language statistics diff --git a/.travis/check-links.sh b/.travis/check-links.sh index 3d3f03c1858..6678b2a6101 100755 --- a/.travis/check-links.sh +++ b/.travis/check-links.sh @@ -1,6 +1,7 @@ #!/bin/bash -cd "$(dirname "${BASH_SOURCE[0]}")/.." +cd "$(dirname "${BASH_SOURCE[0]}")/.." \ + || exit 1 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -8,8 +9,9 @@ find . -name "*.md" \ -not -path "./node_modules/*" \ -not -path "./dist/*" \ -not -path "./coverage/*" \ - | xargs awesome_bot \ - --allow-dupe \ - --allow-redirect \ - --set-timeout 150 \ - --white-list "example1.com,example2.com,example3.com" + -exec awesome_bot \ + --allow-dupe \ + --allow-redirect \ + --set-timeout 150 \ + --white-list "example1.com,example2.com,example3.com" \ + {} + diff --git a/.travis/trigger-site-docs-build.sh b/.travis/trigger-site-docs-build.sh index bcdc1914d5d..3924bd5220b 100755 --- a/.travis/trigger-site-docs-build.sh +++ b/.travis/trigger-site-docs-build.sh @@ -1,9 +1,20 @@ #!/bin/bash -cd "$(dirname "${BASH_SOURCE[0]}")/.." +cd "$(dirname "${BASH_SOURCE[0]}")/.." \ + || exit 1 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Only execute the following if the commit: +# +# * doesn't come from a pull request +# * is made to the `master` branch + +if [ "$TRAVIS_PULL_REQUEST" = "true" ] || + [ "$TRAVIS_BRANCH" != "master" ]; then + exit 0 +fi + # If something changed in `docs/` in the last 3 commits, trigger # an update of the documentation in the repository of the website.