File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 99 "encoding/base64"
1010 "fmt"
1111 "net/url"
12- // "strings"
12+ "strings"
1313
1414 "github.com/drone/go-scm/scm"
1515)
@@ -208,8 +208,10 @@ func generateURIFromRef(ref string) (uri string) {
208208 if ref != "" {
209209 if len (ref ) == 40 {
210210 return fmt .Sprintf ("&versionDescriptor.versionType=commit&versionDescriptor.version=%s" , ref )
211+ } else if strings .HasPrefix (ref , "refs/tags/" ) {
212+ return fmt .Sprintf ("&versionDescriptor.versionType=tag&versionDescriptor.version=%s" , scm .TrimRef (ref ))
211213 } else {
212- return fmt .Sprintf ("&versionDescriptor.versionType=tag &versionDescriptor.version=%s" , ref )
214+ return fmt .Sprintf ("&versionDescriptor.versionType=branch &versionDescriptor.version=%s" , ref )
213215 }
214216 }
215217 return ""
You can’t perform that action at this time.
0 commit comments