Skip to content

Commit 3b2cd51

Browse files
committed
Fix check for commit ranges in racing PRs.
See facebook#1768 / facebook#2000 for original issue. See travis-ci/travis-ci#1719 (comment) for problem description and origin of this fix. This is still a temporary fix until travis-ci/travis-core#383 is merged.
1 parent b36c9f6 commit 3b2cd51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ cache:
88
before_install:
99
- |
1010
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
11-
TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH"
11+
PR_FIRST=$(curl -s https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST}.patch | head -1 | grep -o -E '\b[0-9a-f]{40}\b' | tr -d '\n')
12+
TRAVIS_COMMIT_RANGE=$PR_FIRST^..$TRAVIS_COMMIT
1213
fi
1314
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/' || {
1415
echo "Only docs were updated, stopping build process."

0 commit comments

Comments
 (0)