-
Notifications
You must be signed in to change notification settings - Fork 234
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
DRONE_COMMIT_BRANCH refers to target, not source branch in merge requests #11
Comments
Hmmm, I am unable to reproduce this issue (drone 1.0.0-rc.5). The mapping of source and target branch for merge request for GitLab can be found here: |
For anyone who finds this in the future, you want DRONE_SOURCE_BRANCH. |
@bradrydzewski So, we agree that |
nope, DRONE_COMMIT_BRANCH has always been the target branch, including in 0.8. In 1.0 we also provide more explicit values DRONE_SOURCE_BRANCH and DRONE_TARGET_BRANCH |
I don't think so: https://github.com/drone/drone/blob/768ed784bd74b0e0c2d8d49c4c8b6dca99b25e96/remote/gitlab/gitlab.go#L530 |
for GitHub and other providers it was target branch. If GitLab were using source branch previously it was a bug. The 1.0 implementation is the desired state. |
But IMO, it should be source branch, as target branch often is The question is: Is there any env that we can use to refer to the source branch (for both |
yes, you can use DRONE_SOURCE_BRANCH for push and pull_request events. |
Type:
Bug report. I have a single drone instance running hooked up to a gitlab server via webhooks.
What happened:
Both https://docs.drone.io/reference/environ/drone-commit-branch/ and https://docs.drone.io/reference/environ/drone-branch/ refer to the target branch in builds triggered by merge requests.
Expected:
Both https://docs.drone.io/reference/environ/drone-commit-branch/ and https://docs.drone.io/reference/environ/drone-branch/ should refer to the source branch, while https://docs.drone.io/reference/environ/drone-target-branch/ should refer to the target.
I suspect this is a gitlab issue, and is probably not reproducible on github.
The text was updated successfully, but these errors were encountered: