Skip to content

Commit 708b91a

Browse files
crisbetojelbourn
authored andcommitted
build: don't skip master build when only md files have changed (#9879)
Scopes the logic, that skips the build if only Markdown files, only to PR builds. This avoids issues where we merge in a lot of PRs to master, followed by a docs PR which ends up silencing potential build errors.
1 parent b6e7174 commit 708b91a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

scripts/ci/travis-testing.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@ cd $(dirname $0)/../..
1717
source scripts/ci/sources/mode.sh
1818
source scripts/ci/sources/tunnel.sh
1919

20-
# Get commit diff
21-
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
22-
fileDiff=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
23-
else
20+
# Get the commit diff and skip the build if only .md files have changed.
21+
# Should not apply to master builds.
22+
if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
2423
fileDiff=$(git diff --name-only $TRAVIS_BRANCH...HEAD)
25-
fi
2624

27-
# Check if tests can be skipped
28-
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then
29-
echo "Skipping tests since only markdown files changed."
30-
exit 0
25+
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then
26+
echo "Skipping tests because only markdown files changed."
27+
exit 0
28+
fi
3129
fi
3230

3331
start_tunnel

0 commit comments

Comments
 (0)