-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Workflow names instead of workflow file name #31474
base: main
Are you sure you want to change the base?
Conversation
{{- end -}} | ||
{{$CurWorkflow := $.CurWorkflow}} | ||
{{$WorkflowName := .Workflow.Name}} | ||
{{with .ActionRun}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable shadowing is more complex now. And the name Run
also seems ambiguous
I think it's better to do so:
{{range $run = .WorkflowActionRuns}}
{{$actionRun := $run.ActionRun}}
{{$workflow = $run.Workflow}}
{{$actionRun.Title}}
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the idea, I did the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I tested in GitHub actions and they show the full path to the file when workflow name is absent, e.g. |
IIRC, GitHub has some bugs of display workflow name. That’s why no one fix this issue for a long time I think. |
Do you have any idea which special cases I should check or where I should look for them? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as per @yp05327, we should probably iron out edge cases first
Stale for long time |
Fixes #31458 and maybe #25912
I added the name from the YAML file to the workflow object. If there is no name in the file, the name remains the filename.
I created an object to connect the run and workflow together, which was necessary to show workflow name in action run list.
(Easier to review with disabled whitespace changes, unfortunately there is a lot of them in runs_list.tmpl :( )