diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 30d16b8dc9..d634a49bb9 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -461,7 +461,9 @@ func rerunJob(ctx *context_module.Context, job *actions_model.ActionRunJob, shou actions_service.CreateCommitStatus(ctx, job) // Sync run status with db job.Run = nil - _ = job.LoadAttributes(ctx) + if err := job.LoadAttributes(ctx); err != nil { + return err + } notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run) notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) @@ -568,7 +570,10 @@ func Cancel(ctx *context_module.Context) { job := updatedjobs[0] // Sync run status with db job.Run = nil - job.LoadAttributes(ctx) + if err := job.LoadAttributes(ctx); err != nil { + ctx.HTTPError(http.StatusInternalServerError, err.Error()) + return + } notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run) } ctx.JSON(http.StatusOK, struct{}{}) diff --git a/services/actions/job_emitter.go b/services/actions/job_emitter.go index 6504c8e1bb..e0cf1136f2 100644 --- a/services/actions/job_emitter.go +++ b/services/actions/job_emitter.go @@ -89,7 +89,9 @@ func checkJobsOfRun(ctx context.Context, runID int64) error { if runUpdated { // Sync run status with db jobs[0].Run = nil - jobs[0].LoadAttributes(ctx) + if err := jobs[0].LoadAttributes(ctx); err != nil { + return err + } run := jobs[0].Run notify_service.WorkflowRunStatusUpdate(ctx, run.Repo, run.TriggerUser, run) }