mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-01 20:59:45 +09:00
enhance(actions): add pending job status and align job statuses with GitHub (#39376)
This commit is contained in:
@@ -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