You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just noticed that all of my builds are uploading with their branch set to HEAD. IIUC, this is because of the way Travis builds work—they clone the repository then checkout a specific commit (e.g. abc) rather than a branch name (e.g. master):
$ git clone --branch=master https://github.com/unsplash/unsplash-web.git unsplash/unsplash-webCloning into 'unsplash/unsplash-web'...
$ cd unsplash/unsplash-web
$ git checkout -qf 67babfc8143aab900f9660c2c933388e0b9e7125
This means that when the build tracker CLI tries to infer the branch name via git rev-parse --abbrev-ref HEAD, we will get HEAD instead of the actual branch name.
You can see this for yourself by running these commands locally:
I understand this is why the --branch flag is useful. Perhaps we could have some docs on the site to outline the problem and the recommended solution, as otherwise it might not be obvious why this happens nor how to fix it?
I just noticed that all of my builds are uploading with their
branch
set toHEAD
. IIUC, this is because of the way Travis builds work—they clone the repository then checkout a specific commit (e.g.abc
) rather than a branch name (e.g.master
):This means that when the build tracker CLI tries to infer the branch name via
git rev-parse --abbrev-ref HEAD
, we will getHEAD
instead of the actual branch name.You can see this for yourself by running these commands locally:
I understand this is why the
--branch
flag is useful. Perhaps we could have some docs on the site to outline the problem and the recommended solution, as otherwise it might not be obvious why this happens nor how to fix it?For future reference, I managed to specify the branch name using the environment variables provided by Travis:
TRAVIS_PULL_REQUEST_BRANCH
andTRAVIS_BRANCH
(https://docs.travis-ci.com/user/environment-variables/#default-environment-variables).The text was updated successfully, but these errors were encountered: