mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 01:44:26 +02:00
enhance(actions): add pending job status and align job statuses with GitHub (#39376)
This commit is contained in:
1 parent
0d09986790
commit
9e7b302bd3
45 files changed
+397
-189
No files matched your search
@@ -343,7 +343,7 @@ func getWorkflowRunPayloadInfo(p *api.WorkflowRunPayload, linkFormatter linkForm
|
||||
|
||||
text = fmt.Sprintf("Workflow Run %s: %s", p.Action, refLink)
|
||||
switch description {
|
||||
case "waiting":
|
||||
case "waiting", "pending":
|
||||
color = orangeColor
|
||||
case "queued":
|
||||
color = orangeColorLight
|
||||
|
||||
@@ -998,6 +998,14 @@ func notifyPackage(ctx context.Context, sender *user_model.User, pd *packages_mo
|
||||
}
|
||||
|
||||
func (*webhookNotifier) WorkflowJobStatusUpdate(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, job *actions_model.ActionRunJob, task *actions_model.ActionTask) {
|
||||
if err := job.LoadRun(ctx); err != nil {
|
||||
log.Error("LoadRun: %v", err)
|
||||
return
|
||||
}
|
||||
status, _ := convert.ToRunActionsStatus(job.Run, job.Status)
|
||||
if status == "requested" || status == "pending" {
|
||||
return // announce a job only once it is queued
|
||||
}
|
||||
source := EventSource{
|
||||
Repository: repo,
|
||||
Owner: repo.Owner,
|
||||
@@ -1008,8 +1016,6 @@ func (*webhookNotifier) WorkflowJobStatusUpdate(ctx context.Context, repo *repo_
|
||||
org = convert.ToOrganization(ctx, organization.OrgFromUser(repo.Owner))
|
||||
}
|
||||
|
||||
status, _ := convert.ToActionsStatus(job.Status)
|
||||
|
||||
convertedJob, err := convert.ToActionWorkflowJob(ctx, repo, task, job)
|
||||
if err != nil {
|
||||
log.Error("ToActionWorkflowJob: %v", err)
|
||||
|
||||
Reference in new issue
Block a user