diff --git a/routers/web/repo/actions/badge.go b/routers/web/repo/actions/badge.go index 30a5bb3b24d..2a95ed66eb2 100644 --- a/routers/web/repo/actions/badge.go +++ b/routers/web/repo/actions/badge.go @@ -31,6 +31,8 @@ func GetWorkflowBadge(ctx *context.Context) { } if len(tags) != 0 { tag = tags[0].Name + } else { + tag = "" // return empty result on no tag } ref = fmt.Sprintf("refs/tags/%s", tag) case tag != "":