Skip to content

Add "Run" prefix for unnamed action steps#36624

Merged
lunny merged 29 commits into
go-gitea:mainfrom
silverwind:runprefix
Feb 17, 2026
Merged

Add "Run" prefix for unnamed action steps#36624
lunny merged 29 commits into
go-gitea:mainfrom
silverwind:runprefix

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Feb 14, 2026

Steps defined with run: or uses: without an explicit name: now display with a "Run " prefix in the Actions log UI, matching GitHub Actions behavior.

image

Steps defined with `run:` or `uses:` but without an explicit `name:` now
display with a "Run <cmd>" prefix in the Actions log UI, matching GitHub
Actions behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2026
@silverwind silverwind requested a review from Copilot February 14, 2026 13:00
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@silverwind silverwind added type/enhancement An improvement of existing functionality topic/gitea-actions related to the actions of Gitea labels Feb 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Actions run log UI so that workflow steps without an explicit name: get a “Run …” prefixed display name, aligning the step list presentation with GitHub Actions behavior.

Changes:

  • Add server-side logic in the Actions log view model conversion to prefix unnamed steps using a localized string.
  • Add an English locale string for the new prefix.
  • Add a unit test covering step summary generation for named vs unnamed steps.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
routers/web/repo/actions/view.go Prefixes unnamed workflow steps with a localized “Run %s” display string during view model conversion.
routers/web/repo/actions/view_test.go Adds a focused test asserting step summary output for unnamed uses:/run: steps and named steps.
options/locale/locale_en-US.json Introduces actions.runs.run_prefix translation key (“Run %s”).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread routers/web/repo/actions/view.go Outdated
Comment thread routers/web/repo/actions/view.go Outdated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wxiaoguang
Copy link
Copy Markdown
Contributor

Your AI doesn't understand this?

image

@wxiaoguang wxiaoguang marked this pull request as draft February 14, 2026 14:24
@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Feb 14, 2026

What's wrong? Constructive feedback please.

If you want a simpler alternative implementation I can revert 954fe95, but Copilot did not like the mutation.

@silverwind silverwind marked this pull request as ready for review February 14, 2026 14:40
@wxiaoguang
Copy link
Copy Markdown
Contributor

wxiaoguang commented Feb 14, 2026

It is wrong.

Everything every time I told you what's wrong, you just don't understand.

I won't waste time on you and your AI crap

Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix the wrong and fragile logic generated by AI

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 14, 2026
@silverwind
Copy link
Copy Markdown
Member Author

Tell me what's wrong. I don't play guessing games.

@silverwind silverwind removed the lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged label Feb 14, 2026
@GiteaBot GiteaBot added the lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged label Feb 14, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor

wxiaoguang commented Feb 14, 2026

Give me a reason why I should waste time on you. #36618 (comment)

@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Feb 14, 2026

I've reverted the complication that came from the Copilot, now the code is very easy to understand, it adds the prefix into step.Name:

if task.Job != nil {
  if wj, err := task.Job.ParseJob(); err == nil {
    for i, step := range task.Steps {
      if i < len(wj.Steps) && wj.Steps[i].Name == "" {
        step.Name = ctx.Locale.TrString("actions.runs.run", step.Name)
      }
    }
  }
}

@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Feb 14, 2026

I guess I could move the prefixing into the template rendering as well. Then there are no dirty mutations in the go code.

silverwind and others added 2 commits February 14, 2026 17:03
Instead of applying the prefix at display time (which required
re-parsing the workflow YAML on every view and duplicating logic
across the web UI and API), apply it in CreateTaskForRunner when
step names are first generated. This matches GitHub Actions behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@silverwind
Copy link
Copy Markdown
Member Author

I've changed the prefixing to be done at creation time, before it's inserted into the database, which means the prefixing only applies for new runs and can not be localized.

Maybe that is more to @wxiaoguang's liking, I don't know what they want exactly, so this is a all a guesswork.

@silverwind silverwind marked this pull request as ready for review February 15, 2026 21:55
@ChristopherHX ChristopherHX self-requested a review February 15, 2026 22:00
Comment thread models/actions/task.go Outdated
silverwind and others added 2 commits February 16, 2026 03:58
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread models/actions/task.go Outdated
Comment thread models/actions/task_test.go Outdated
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 17, 2026
Copy link
Copy Markdown
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this manually

  • rerun an existing job => new naming schema applied
  • a new test workflow has also better step names

Comment thread routers/web/repo/actions/view.go
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 17, 2026
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 17, 2026
@lunny lunny enabled auto-merge (squash) February 17, 2026 20:17
@lunny lunny merged commit e791121 into go-gitea:main Feb 17, 2026
24 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 17, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 17, 2026
@wxiaoguang wxiaoguang deleted the runprefix branch February 18, 2026 01:06
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 18, 2026
Steps defined with `run:` or `uses:` without an explicit `name:` now
display with a "Run <cmd>" prefix in the Actions log UI, matching GitHub
Actions behavior.

<img width="311" height="236" alt="image"
src="https://github.com/user-attachments/assets/9fde83f5-c43a-4732-ac55-0f4e1fbc1314"
/>

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/gitea-actions related to the actions of Gitea type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants