enhance(actions): show workflow name from YAML instead of filename (#37833)

Use the workflow's YAML `name:` field for display in the workflow
sidebar and run list, falling back to the filename when no name is set.

Closes https://github.com/go-gitea/gitea/issues/31458
Closes https://github.com/go-gitea/gitea/issues/25912
Closes https://github.com/go-gitea/gitea/pull/31474
This commit is contained in:
Nicolas
2026-05-25 10:25:22 +02:00
committed by GitHub
parent 6f4027a6be
commit bc6054b56d
3 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
<a class="item {{if not $.CurWorkflow}}active{{end}}" href="?actor={{$.CurActor}}&status={{$.CurStatus}}">{{ctx.Locale.Tr "actions.runs.all_workflows"}}</a>
{{range .workflows}}
<a class="item {{if eq .Entry.Name $.CurWorkflow}}active{{end}}" href="?workflow={{.Entry.Name}}&actor={{$.CurActor}}&status={{$.CurStatus}}">
<span class="gt-ellipsis">{{.Entry.Name}}</span>
<span class="gt-ellipsis">{{.DisplayName}}</span>
{{if .ErrMsg}}
<span class="flex-text-inline" data-tooltip-content="{{.ErrMsg}}">{{svg "octicon-alert" 16 "tw-text-red"}}</span>
+2 -1
View File
@@ -21,7 +21,8 @@
{{end}}
</span>
<div class="item-body">
<span><b>{{if not $.CurWorkflow}}{{$run.WorkflowID}} {{end}}#{{$run.Index}}</b>:</span>
{{$workflowName := index $.WorkflowNames $run.WorkflowID}}
<span><b>{{if not $.CurWorkflow}}{{if $workflowName}}{{$workflowName}}{{else}}{{$run.WorkflowID}}{{end}} {{end}}#{{$run.Index}}</b>:</span>
{{- if $run.ScheduleID -}}
{{ctx.Locale.Tr "actions.runs.scheduled"}}