From 7142a954a8520a1ff0cee4a19ca724d45d5a0cf3 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 14 May 2025 01:47:50 +0800 Subject: [PATCH] fix UpdateRun logic --- models/actions/run.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/models/actions/run.go b/models/actions/run.go index b374558981..76218e6e42 100644 --- a/models/actions/run.go +++ b/models/actions/run.go @@ -4,6 +4,7 @@ package actions import ( + "code.gitea.io/gitea/modules/setting" "context" "errors" "fmt" @@ -420,10 +421,7 @@ func UpdateRun(ctx context.Context, run *ActionRun, cols ...string) error { if run.Status != 0 || slices.Contains(cols, "status") { if run.RepoID == 0 { - run, err = GetRunByRepoAndID(ctx, run.RepoID, run.ID) - if err != nil { - return err - } + setting.PanicInDevOrTesting("RepoID should not be 0") } if err = run.LoadRepo(ctx); err != nil { return err