From d817b199cab8545a8ea218c5cd62dc7891119c89 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 25 Jul 2023 18:13:36 +0900 Subject: [PATCH] Fix wrong workflow status when rerun a job in an already finished workflow (#26119) Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/fb687592-b117-4cd5-b076-2ca5ca847ea4) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/c9b0683e-e81d-410b-8c35-fbe54327fab4) After workflow finished, if you rerun a single job, the workflow status will become to `Running` which is not correct as no jobs are running in this workflow. --- models/actions/run_job.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/actions/run_job.go b/models/actions/run_job.go index c7620cd8bc..0239cc0a85 100644 --- a/models/actions/run_job.go +++ b/models/actions/run_job.go @@ -150,7 +150,7 @@ func aggregateJobStatus(jobs []*ActionRunJob) Status { if !job.Status.IsDone() { allDone = false } - if job.Status != StatusWaiting { + if job.Status != StatusWaiting && !job.Status.IsDone() { allWaiting = false } if job.Status == StatusFailure || job.Status == StatusCancelled {