Skip to content

Commit

Permalink
Fix wrong workflow status when rerun a job in an already finished wor…
Browse files Browse the repository at this point in the history
…kflow (#26119) (#26124)

Backport #26119 by @yp05327

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.

Co-authored-by: yp05327 <576951401@qq.com>
  • Loading branch information
GiteaBot and yp05327 authored Jul 25, 2023
1 parent 3e07c54 commit 08cdc0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/actions/run_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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 {
Expand Down

0 comments on commit 08cdc0d

Please sign in to comment.