Skip to content

Commit

Permalink
add tag support for content list api azure
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavharness committed Feb 19, 2025
1 parent d6b7671 commit 6a6fa10
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scm/driver/azure/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"encoding/base64"
"fmt"
"net/url"
// "strings"
"strings"

"github.com/drone/go-scm/scm"
)
Expand Down Expand Up @@ -208,8 +208,10 @@ func generateURIFromRef(ref string) (uri string) {
if ref != "" {
if len(ref) == 40 {
return fmt.Sprintf("&versionDescriptor.versionType=commit&versionDescriptor.version=%s", ref)
} else if strings.HasPrefix(ref, "refs/tags/") {
return fmt.Sprintf("&versionDescriptor.versionType=tag&versionDescriptor.version=%s", scm.TrimRef(ref))
} else {
return fmt.Sprintf("&versionDescriptor.versionType=tag&versionDescriptor.version=%s", ref)
return fmt.Sprintf("&versionDescriptor.versionType=branch&versionDescriptor.version=%s", ref)
}
}
return ""
Expand Down

0 comments on commit 6a6fa10

Please sign in to comment.