From 547d2202d9002bbaa451f74388e65cf0266bac45 Mon Sep 17 00:00:00 2001 From: Christopher Homberger Date: Sun, 23 Feb 2025 17:06:50 +0100 Subject: [PATCH] lint --- services/notify/notifier.go | 3 +-- services/webhook/notifier.go | 12 ++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/services/notify/notifier.go b/services/notify/notifier.go index 450ac878ea..ec83882c26 100644 --- a/services/notify/notifier.go +++ b/services/notify/notifier.go @@ -6,7 +6,6 @@ package notify import ( "context" - "code.gitea.io/gitea/models/actions" actions_model "code.gitea.io/gitea/models/actions" git_model "code.gitea.io/gitea/models/git" issues_model "code.gitea.io/gitea/models/issues" @@ -80,5 +79,5 @@ type Notifier interface { CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, commit *repository.PushCommit, sender *user_model.User, status *git_model.CommitStatus) - CreateWorkflowJob(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, job *actions.ActionRunJob, task *actions_model.ActionTask) + CreateWorkflowJob(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, job *actions_model.ActionRunJob, task *actions_model.ActionTask) } diff --git a/services/webhook/notifier.go b/services/webhook/notifier.go index 7483cc9261..499574cf2d 100644 --- a/services/webhook/notifier.go +++ b/services/webhook/notifier.go @@ -954,14 +954,18 @@ func (*webhookNotifier) CreateWorkflowJob(ctx context.Context, repo *repo_model. org = convert.ToOrganization(ctx, organization.OrgFromUser(repo.Owner)) } - job.LoadAttributes(ctx) + err := job.LoadAttributes(ctx) + if err != nil { + log.Error("Error loading job attributes: %v", err) + return + } action, conclusion := toActionStatus(job.Status) - var runnerId int64 + var runnerID int64 var steps []*api.ActionWorkflowStep if task != nil { - runnerId = task.RunnerID + runnerID = task.RunnerID for i, step := range task.Steps { _, stepConclusion := toActionStatus(job.Status) steps = append(steps, &api.ActionWorkflowStep{ @@ -986,7 +990,7 @@ func (*webhookNotifier) CreateWorkflowJob(ctx context.Context, repo *repo_model. HeadSha: job.Run.CommitSHA, HeadBranch: git.RefName(job.Run.Ref).BranchName(), Conclusion: conclusion, - RunnerID: runnerId, + RunnerID: runnerID, Steps: steps, CreatedAt: job.Created.AsTime().UTC(), StartedAt: job.Started.AsTime().UTC(),