Skip to content

Commit 1485889

Browse files
committed
check deleted run
1 parent 16bd04f commit 1485889

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

services/actions/commit_status.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
actions_module "code.gitea.io/gitea/modules/actions"
2121
"code.gitea.io/gitea/modules/commitstatus"
2222
"code.gitea.io/gitea/modules/log"
23+
"code.gitea.io/gitea/modules/util"
2324
webhook_module "code.gitea.io/gitea/modules/webhook"
2425
commitstatus_service "code.gitea.io/gitea/services/repository/commitstatus"
2526

@@ -70,6 +71,10 @@ func GetRunsAndJobsFromCommitStatuses(ctx context.Context, statuses []*git_model
7071
if !ok {
7172
run, err = actions_model.GetRunByIndex(ctx, status.RepoID, runIndex)
7273
if err != nil {
74+
if errors.Is(err, util.ErrNotExist) {
75+
// the run may be deleted manually, just skip it
76+
continue
77+
}
7378
return nil, nil, fmt.Errorf("GetRunByIndex: %w", err)
7479
}
7580
runMap[runIndex] = run

0 commit comments

Comments
 (0)