mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 14:03:24 +09:00
Backport #38653 by @Zettat123 The handler of `/actions/runs/{run}/approve` doesn't check if the run is already approved. If a run is re-approved, its jobs' status will be reset to `StatusWaiting`, causing incorrect job status. Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
@@ -28,6 +28,9 @@ func ApproveRuns(ctx context.Context, repo *repo_model.Repository, doer *user_mo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !run.NeedApproval {
|
||||
continue
|
||||
}
|
||||
run.NeedApproval = false
|
||||
run.ApprovedBy = doer.ID
|
||||
if err := actions_model.UpdateRun(ctx, run, "need_approval", "approved_by"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user