Skip to content

Commit 6a6fa10

Browse files
committed
add tag support for content list api azure
1 parent d6b7671 commit 6a6fa10

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scm/driver/azure/content.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
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 ""

0 commit comments

Comments
 (0)