From 1637d129b9c3fd525a702ec60de9407636d2c5e3 Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Wed, 13 Nov 2024 19:10:26 -0500 Subject: [PATCH] feat: return empty result on no tag --- routers/web/repo/actions/badge.go | 2 ++ 1 file changed, 2 insertions(+) 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 != "":