0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-12 14:13:05 +01:00

feat: return empty result on no tag

This commit is contained in:
BoYanZh 2024-11-13 19:10:26 -05:00
parent 3dea5ee2fb
commit 1637d129b9
No known key found for this signature in database
GPG key ID: CA088E6D9284F870

View file

@ -31,6 +31,8 @@ func GetWorkflowBadge(ctx *context.Context) {
} }
if len(tags) != 0 { if len(tags) != 0 {
tag = tags[0].Name tag = tags[0].Name
} else {
tag = "" // return empty result on no tag
} }
ref = fmt.Sprintf("refs/tags/%s", tag) ref = fmt.Sprintf("refs/tags/%s", tag)
case tag != "": case tag != "":