Closed dhensby closed 8 years ago
What happens if you upload a feature branch to this repo? I think that we only want to run this code on the master branch, rather than suppress it only for pull request builds. Is that right?
@sminnee that's a good point - yes, if a feature branch is created travis will currently build to gh-pages
we can use $TRAVIS_BRANCH
for determining the branch - this needs to be used in conjunction with the pull request test too
From https://docs.travis-ci.com/user/environment-variables/ :
For builds not triggered by a pull request this is the name of the branch currently being built; whereas for builds triggered by a pull request this is the name of the branch targeted by the pull request (in many cases this will be master).
So these conditionals should be probably be [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_BRANCH}" = "master" ]
then?
Yep
I added my suggestion as a 2nd commit.
At the moment the travis script isn't meant for PRs, this change will allow us to run tests on PRs and publish the binary on merge.