0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-20 23:28:28 +02:00

change action of workflow_run to align

This commit is contained in:
Christopher Homberger 2025-03-21 22:13:39 +01:00
parent 4629a68229
commit 9b3eb4c180
3 changed files with 16 additions and 2 deletions

View File

@ -774,7 +774,7 @@ func (n *actionsNotifier) WorkflowRunStatusUpdate(ctx context.Context, repo *rep
org = convert.ToOrganization(ctx, organization.OrgFromUser(repo.Owner))
}
status, _ := convert.ToActionsStatus(run.Status)
status := convert.ToWorkflowRunAction(run.Status)
gitRepo, err := gitrepo.OpenRepository(context.Background(), repo)
if err != nil {

View File

@ -258,6 +258,20 @@ func ToActionWorkflowRun(ctx context.Context, repo *repo_model.Repository, run *
}, nil
}
func ToWorkflowRunAction(status actions_model.Status) string {
var action string
switch status {
case actions_model.StatusWaiting, actions_model.StatusBlocked:
action = "requested"
case actions_model.StatusRunning:
action = "in_progress"
}
if status.IsDone() {
action = "completed"
}
return action
}
func ToActionsStatus(status actions_model.Status) (string, string) {
var action string
var conclusion string

View File

@ -985,7 +985,7 @@ func (*webhookNotifier) WorkflowRunStatusUpdate(ctx context.Context, repo *repo_
org = convert.ToOrganization(ctx, organization.OrgFromUser(repo.Owner))
}
status, _ := convert.ToActionsStatus(run.Status)
status := convert.ToWorkflowRunAction(run.Status)
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
if err != nil {