diff --git a/services/actions/notifier.go b/services/actions/notifier.go index a7ae52d4f3..1039d48cbd 100644 --- a/services/actions/notifier.go +++ b/services/actions/notifier.go @@ -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 { diff --git a/services/convert/convert.go b/services/convert/convert.go index 9fcda5f46f..0ce6bf15d3 100644 --- a/services/convert/convert.go +++ b/services/convert/convert.go @@ -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 diff --git a/services/webhook/notifier.go b/services/webhook/notifier.go index cc40dd3377..dc44460860 100644 --- a/services/webhook/notifier.go +++ b/services/webhook/notifier.go @@ -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 {