Skip to content

Commit cdbd120

Browse files
authored
build: exit early if only documentation is being updated (#4583)
1 parent 37001b3 commit cdbd120

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ branches:
1111
- master
1212
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
1313
install: "npm i && npm update"
14+
before_install:
15+
- | # quickly pass if only documentation is being updated
16+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
17+
TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH"
18+
fi
19+
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/' || {
20+
echo "Only docs were updated, stopping build process."
21+
exit
22+
}
1423
before_deploy:
1524
- npm run build
1625
env:

0 commit comments

Comments
 (0)