Skip to content

Use run-name and evaluate workflow variables#34301

Merged
lunny merged 40 commits into
go-gitea:mainfrom
badhezi:dev/hezi/fix-run-name
May 20, 2025
Merged

Use run-name and evaluate workflow variables#34301
lunny merged 40 commits into
go-gitea:mainfrom
badhezi:dev/hezi/fix-run-name

Conversation

@badhezi

@badhezi badhezi commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

This addresses #34247
depends on https://gitea.com/gitea/act/pulls/137

I couldn't find any previous implementation for run-name support on workflows so I created one.

Key points:
All dispatched workflows, scheduled workflows and detected workflows (from different hooks) will use and evaluate run-name if exists, with the corresponding gitea context and variables. This will be used as the Action run title and replace the default commit message being used today.

Had to change act package jobparser (see link above)
and create two helpers

func (s *ActionSchedule) ToActionRun() *ActionRun {

and
func (g *GiteaContext) ToGitHubContext() *model.GithubContext {

to pass the correct types to GenerateGiteaContext and WithGitContext respectively.

Screenshot 2025-04-28 at 17 13 01

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 28, 2025
@badhezi badhezi changed the title Dev/hezi/fix run name Use run-name and evaluate workflow variables Apr 28, 2025
@TheFox0x7

Copy link
Copy Markdown
Contributor

Shouldn't this go to jobparser?

@badhezi

badhezi commented Apr 29, 2025

Copy link
Copy Markdown
Contributor Author

@TheFox0x7
Created https://gitea.com/gitea/act/pulls/136 to move most of the logic to jobparser

@badhezi badhezi force-pushed the dev/hezi/fix-run-name branch from cca335d to 9408c76 Compare April 29, 2025 12:17
@badhezi

badhezi commented May 12, 2025

Copy link
Copy Markdown
Contributor Author

Hey @lunny you think I can get someone to review https://gitea.com/gitea/act/pulls/137 so we can push this forward?
Thanks.

@lunny

lunny commented May 12, 2025

Copy link
Copy Markdown
Member

Hey @lunny you think I can get someone to review https://gitea.com/gitea/act/pulls/137 so we can push this forward? Thanks.

That PR merged.

@badhezi

badhezi commented May 12, 2025

Copy link
Copy Markdown
Contributor Author

Hey @lunny you think I can get someone to review https://gitea.com/gitea/act/pulls/137 so we can push this forward? Thanks.

That PR merged.

Thanks @lunny
Should I want for a new tag release of gitea/act or is there anything else to do?

@lunny

lunny commented May 12, 2025

Copy link
Copy Markdown
Member

Hey @lunny you think I can get someone to review https://gitea.com/gitea/act/pulls/137 so we can push this forward? Thanks.

That PR merged.

Thanks @lunny Should I want for a new tag release of gitea/act or is there anything else to do?

v0.261.6 tagged.

@badhezi

badhezi commented May 13, 2025

Copy link
Copy Markdown
Contributor Author

Can this PR please be reviewed?
@wxiaoguang @lunny
Thanks

@lunny lunny added this to the 1.25.0 milestone May 13, 2025
Comment thread services/actions/workflow.go Outdated
@badhezi badhezi requested a review from Zettat123 May 16, 2025 22:03
Comment thread services/actions/notifier_helper.go
Comment thread services/actions/context.go Outdated
@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 May 17, 2025
@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 May 18, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 19, 2025
@lunny lunny enabled auto-merge (squash) May 20, 2025 02:02
@lunny lunny merged commit 0534edd into go-gitea:main May 20, 2025
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 20, 2025
Comment thread services/actions/context.go
@lunny lunny mentioned this pull request May 20, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 21, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Fix ephemeral runner deletion (go-gitea#34447)
  ui: add a default tab on repo header when migrating (go-gitea#34503)
  Use run-name and evaluate workflow variables (go-gitea#34301)
  feat(api): add date range filtering to commit retrieval endpoints (go-gitea#34497)
  Export repo's manual merge settings (go-gitea#34502)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 18, 2025
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants