From 9a206b9680b107c5ca47d579ed079d4155d011b8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 4 Dec 2023 23:36:54 -0800 Subject: [PATCH] Fix the runs will not be displayed bug when the main branch have no workflows but other branches have --- 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 3b10f0b9571eb..fd541647b716e 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 ede4c82602da2..62d30305b3603 100644 --- a/templates/repo/actions/list.tmpl +++ b/templates/repo/actions/list.tmpl @@ -4,7 +4,7 @@
{{template "base/alert" .}} - {{if .workflows}} + {{if .HasWorkflowsOrRuns}}