Skip to content

Commit 547d220

Browse files
committed
lint
1 parent 1a16ea3 commit 547d220

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

services/notify/notifier.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package notify
66
import (
77
"context"
88

9-
"code.gitea.io/gitea/models/actions"
109
actions_model "code.gitea.io/gitea/models/actions"
1110
git_model "code.gitea.io/gitea/models/git"
1211
issues_model "code.gitea.io/gitea/models/issues"
@@ -80,5 +79,5 @@ type Notifier interface {
8079

8180
CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, commit *repository.PushCommit, sender *user_model.User, status *git_model.CommitStatus)
8281

83-
CreateWorkflowJob(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, job *actions.ActionRunJob, task *actions_model.ActionTask)
82+
CreateWorkflowJob(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, job *actions_model.ActionRunJob, task *actions_model.ActionTask)
8483
}

services/webhook/notifier.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,14 +954,18 @@ func (*webhookNotifier) CreateWorkflowJob(ctx context.Context, repo *repo_model.
954954
org = convert.ToOrganization(ctx, organization.OrgFromUser(repo.Owner))
955955
}
956956

957-
job.LoadAttributes(ctx)
957+
err := job.LoadAttributes(ctx)
958+
if err != nil {
959+
log.Error("Error loading job attributes: %v", err)
960+
return
961+
}
958962

959963
action, conclusion := toActionStatus(job.Status)
960-
var runnerId int64
964+
var runnerID int64
961965
var steps []*api.ActionWorkflowStep
962966

963967
if task != nil {
964-
runnerId = task.RunnerID
968+
runnerID = task.RunnerID
965969
for i, step := range task.Steps {
966970
_, stepConclusion := toActionStatus(job.Status)
967971
steps = append(steps, &api.ActionWorkflowStep{
@@ -986,7 +990,7 @@ func (*webhookNotifier) CreateWorkflowJob(ctx context.Context, repo *repo_model.
986990
HeadSha: job.Run.CommitSHA,
987991
HeadBranch: git.RefName(job.Run.Ref).BranchName(),
988992
Conclusion: conclusion,
989-
RunnerID: runnerId,
993+
RunnerID: runnerID,
990994
Steps: steps,
991995
CreatedAt: job.Created.AsTime().UTC(),
992996
StartedAt: job.Started.AsTime().UTC(),

0 commit comments

Comments
 (0)