Skip to content
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

Add support for refs to BuildLast #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dschmidt
Copy link

@dschmidt dschmidt commented Dec 7, 2020

No description provided.

@CLAassistant
Copy link

CLAassistant commented Dec 7, 2020

CLA assistant check
All committers have signed the CLA.

@dschmidt
Copy link
Author

ping

1 similar comment
@dschmidt
Copy link
Author

ping

@dschmidt
Copy link
Author

This is the main (remaining) reason we have to maintain our fork at https://github.com/owncloud-ci/drone-cli
I would really like to get this or an equivalent fix merged at some point.

@dschmidt
Copy link
Author

ping?

@@ -266,7 +266,11 @@ func (c *client) BuildLast(owner, name, branch string) (*Build, error) {
out := new(Build)
uri := fmt.Sprintf(pathBuild, c.addr, owner, name, "latest")
if branch != "" {
uri += "?branch=" + branch
if strings.HasPrefix(branch, "refs/") {
uri += "?ref=" + branch
Copy link
Contributor

@eoinmcafee00 eoinmcafee00 Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be cleaner to create a new function BuildLastRef and call the parameter ref. This change still uses "branch" which isn't as clear to read.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also with this change the comment is no longer correct.

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

Successfully merging this pull request may close these issues.

4 participants