Closed tdhock closed 9 years ago
travis environment variables http://docs.travis-ci.com/user/environment-variables/
TRAVIS_BRANCH: 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).
TRAVIS_PULL_REQUEST: The pull request number if the current job is a pull request, “false” if it’s not a pull request.
TRAVIS_REPO_SLUG: The slug (in form: owner_name/repo_name) of the repository currently being built. (for example, “travis-ci/travis-build”).
say that you submit a PR from da-ta-vinci21/stringr@some_branch to hadley/stringr@master
TRAVIS_PULL_REQUEST=128 (some number) TRAVIS_BRANCH=some_branch TRAVIS_REPO_SLUG=da-ta-vinci21/stringr
question: how to determine hadley/stringr@master (target of PR)?
if you can't figure it out post an issue to Travis https://github.com/travis-ci/travis-ci/issues/new
I was going through the travis docs and came across this: Security Restrictions when testing Pull Requests. It mentions how the secure or encrypted environment variables won't be available when building a PR from a fork of the repository. That means a PR build won't have access to the encrypted github token which is used to push to the github page. Even if we were to figure out a way to determine the target of PR, it won't do us any good since we won't be able to update the gh-page!
ok that makes sense.
in that case I guess it is OK to only support PRs from the same repos.
how to get a list of commits when the PR comes from a different user?
for example https://github.com/tdhock/animint/pull/78