Skip to content

Commit

Permalink
Merge pull request #329 from drone/CI-16298
Browse files Browse the repository at this point in the history
Add tag ref support for azure content apis
  • Loading branch information
raghavharness authored Feb 19, 2025
2 parents d9147fb + 6a6fa10 commit 4bcbe7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scm/driver/azure/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"encoding/base64"
"fmt"
"net/url"
"strings"

"github.com/drone/go-scm/scm"
)
Expand Down Expand Up @@ -207,6 +208,8 @@ 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=branch&versionDescriptor.version=%s", ref)
}
Expand Down

0 comments on commit 4bcbe7b

Please sign in to comment.