Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TRAVIS_PULL_REQUEST_BRANCH over TRAVIS_BRANCH if available #70

Merged
merged 2 commits into from
Mar 6, 2020

Conversation

Malax
Copy link
Member

@Malax Malax commented Mar 6, 2020

If HATCHET_BUILDPACK_BRANCH nor HEROKU_TEST_RUN_BRANCH are set, Hatchet falls back to Hatchet.git_branch which tries to resolve the branch using git. Before using actual git, it will look for the TRAVIS_BRANCH environment variable and use its value if available instead.

TRAVIS_BRANCH works fine unless the build is a pull-request. In that case, it will contain the target branch not the actual pull-request branch. This results in Hatchet tests running silently against the target branch (most of the time master) and not testing the actual changes in the PR. TRAVIS_PULL_REQUEST_BRANCH contains the correct branch but will be empty for push builds.

See: https://docs.travis-ci.com/user/environment-variables/

@Malax Malax requested review from dzuelke and schneems March 6, 2020 09:52
@schneems schneems merged commit ea67231 into master Mar 6, 2020
@schneems schneems deleted the malax/fix-travis-branch-detection branch March 6, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants