From 233af7e2dff4c79619f5cda6943388ff9e21581b Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Wed, 6 Aug 2014 00:39:55 +0300 Subject: [PATCH] Cancelling Travis build on commits with docs updates only. Currently recognized patterns: * any Markdown files (*.md) * any files in docs or examples directories. Closes facebook/react#1768. --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index cf0ded38147..fbd428c9824 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,15 @@ node_js: cache: directories: - node_modules +before_install: +- | + if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH" + fi + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/' || { + echo "Only docs were updated, stopping build process." + exit + } script: - | grunt $TEST_TYPE