From 09d50284422aa70af47c77e20b65b9f5c5e32c13 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 6 Dec 2023 09:13:59 +0800 Subject: [PATCH] Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) --- routers/web/repo/actions/actions.go | 1 + templates/repo/actions/list.tmpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/web/repo/actions/actions.go b/routers/web/repo/actions/actions.go index 3b10f0b95..fd541647b 100644 --- a/routers/web/repo/actions/actions.go +++ b/routers/web/repo/actions/actions.go @@ -200,6 +200,7 @@ func List(ctx *context.Context) { pager.AddParamString("actor", fmt.Sprint(actorID)) pager.AddParamString("status", fmt.Sprint(status)) ctx.Data["Page"] = pager + ctx.Data["HasWorkflowsOrRuns"] = len(workflows) > 0 || len(runs) > 0 ctx.HTML(http.StatusOK, tplListActions) } diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl index ede4c8260..62d30305b 100644 --- a/templates/repo/actions/list.tmpl +++ b/templates/repo/actions/list.tmpl @@ -4,7 +4,7 @@
{{template "base/alert" .}} - {{if .workflows}} + {{if .HasWorkflowsOrRuns}}