Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Introduce DEFAULT_BASE_BRANCH environment var to fix diff checking on branch builds#229

Merged
westonruter merged 3 commits intomasterfrom
bugfix/pr-check-diff
Aug 10, 2017
Merged

Introduce DEFAULT_BASE_BRANCH environment var to fix diff checking on branch builds#229
westonruter merged 3 commits intomasterfrom
bugfix/pr-check-diff

Conversation

@westonruter
Copy link
Contributor

@westonruter westonruter commented Apr 7, 2017

Fixes #197.

The root of the problem for why branch builds would pass when PR builds would fail, and why the branch build would show fewer changed files than the PR build (when CHECK_SCOPE is patches or changed-files), is due to this line:

DIFF_BASE=${DIFF_BASE:-$TRAVIS_COMMIT^}

Essentially the branch build was only diffing with the previous commit on the branch. As such, the change here is to suggest a GITHUB_DEFAULT_BRANCH environment variable to define what the default branch us for the repo on GitHub (since it doesn't seem to be among the environment vars that Travis exposes), which also assumes that the default branch is going to be the target of the pull request.

I'm not 100% certain this is the right approach, but it seems somewhat better than only comparing with the parent commit.

@westonruter
Copy link
Contributor Author

@rmccue Thoughts on this approach?

@westonruter westonruter mentioned this pull request Aug 10, 2017
@westonruter westonruter changed the title Introduce GITHUB_DEFAULT_BRANCH environment var to fix diff checking on branch builds Introduce DEFAULT_BASE_BRANCH environment var to fix diff checking on branch builds Aug 10, 2017
@westonruter westonruter merged commit 3620031 into master Aug 10, 2017
@westonruter westonruter deleted the bugfix/pr-check-diff branch August 10, 2017 18:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants