Skip to content

Commit 2bac8d8

Browse files
committed
terrible
1 parent d41aee8 commit 2bac8d8

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

services/mailer/mail_workflow_run.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,13 @@ func sendActionsWorkflowRunStatusEmail(ctx context.Context, repo *repo_model.Rep
5353
if err != nil {
5454
log.Error("GetRunJobsByRunID: %v", err)
5555
return
56-
} else {
57-
sort.SliceStable(jobs, func(i, j int) bool {
58-
si := jobs[i].Status
59-
sj := jobs[j].Status
60-
if si == sj || si.IsSuccess() {
61-
return false
62-
}
63-
return si < sj
64-
})
6556
}
57+
sort.SliceStable(jobs, func(i, j int) bool {
58+
si := jobs[i].Status
59+
sj := jobs[j].Status
60+
return !(si == sj || si.IsSuccess()) && si < sj
61+
})
62+
6663
convertedJobs := make([]convertedWorkflowJob, 0, len(jobs))
6764
for _, job := range jobs {
6865
converted0, err := convert.ToActionWorkflowJob(ctx, repo, nil, job)

0 commit comments

Comments
 (0)