Skip to content

Enhance logic of getting current branch in case of drone #1686

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

Merged
merged 2 commits into from
May 21, 2019
Merged

Enhance logic of getting current branch in case of drone #1686

merged 2 commits into from
May 21, 2019

Conversation

vhatsura
Copy link
Contributor

Hey, @arturcic!

It's the 2nd PR related to Drone.

Little introduction:
DRONE_BRANCH environment variable is equal to destination branch in case of pull request details. By this reason, in case of pull request, we need to fetch another environment variable to know current branch. Unfortunately, this is also not simple. In the 1.x.x Drone version it can be fetched from DRONE_SOURCE_BRANCH, however in older version it can be done by parsing CI_COMMIT_REFSPEC environment variable, which has the following format: {sourceBranch}:{destinationBranch}.

The PR implement such logic of fetching current branch name.

@arturcic
Copy link
Member

LGTM! Would be great if we can check the merge messages that Drone creates when PR is merged, and adjust the unit tests in case it is needed. For now I'll merge these changes. Thank you for your time!

@arturcic arturcic merged commit 3ebdf49 into GitTools:master May 21, 2019
@arturcic arturcic added this to the 5.0.0 milestone May 21, 2019
@vhatsura
Copy link
Contributor Author

vhatsura commented May 21, 2019

@arturcic, good point. I will try to check it, however, I don't understand how it's connected with GitVersion?

@vhatsura vhatsura deleted the drone/current_branch branch May 21, 2019 09:15
@arturcic
Copy link
Member

GitVersion can use the merge messages when computing the next version. And each of the supported CI have different message format for the merge commit. Please have a look here

@vhatsura
Copy link
Contributor Author

Got it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants