diff options
author | ChristopherHX <christopher.homberger@web.de> | 2025-03-11 18:40:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-11 10:40:38 -0700 |
commit | 651ef669665066d4f90da3da8471120bda2a2a6b (patch) | |
tree | 54fc3927afd4d59fdae6396452e72abab33bd2df /routers/api/actions | |
parent | f61f30153b51f2db50d96268e718a1319f5c03b2 (diff) | |
download | gitea-651ef669665066d4f90da3da8471120bda2a2a6b.tar.gz gitea-651ef669665066d4f90da3da8471120bda2a2a6b.zip |
Add workflow_job webhook (#33694)
Provide external Integration information about the Queue lossly based on
https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_job
Naming conflicts between GitHub & Gitea are here, Blocked => Waiting,
Waiting => Queued
Rationale Enhancement for ephemeral runners management #33570
Diffstat (limited to 'routers/api/actions')
-rw-r--r-- | routers/api/actions/runner/runner.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/api/actions/runner/runner.go b/routers/api/actions/runner/runner.go index f34dfb443b..27a0317942 100644 --- a/routers/api/actions/runner/runner.go +++ b/routers/api/actions/runner/runner.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/util" actions_service "code.gitea.io/gitea/services/actions" + notify_service "code.gitea.io/gitea/services/notify" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "code.gitea.io/actions-proto-go/runner/v1/runnerv1connect" @@ -210,7 +211,7 @@ func (s *Service) UpdateTask( if err := task.LoadJob(ctx); err != nil { return nil, status.Errorf(codes.Internal, "load job: %v", err) } - if err := task.Job.LoadRun(ctx); err != nil { + if err := task.Job.LoadAttributes(ctx); err != nil { return nil, status.Errorf(codes.Internal, "load run: %v", err) } @@ -219,6 +220,10 @@ func (s *Service) UpdateTask( actions_service.CreateCommitStatus(ctx, task.Job) } + if task.Status.IsDone() { + notify_service.WorkflowJobStatusUpdate(ctx, task.Job.Run.Repo, task.Job.Run.TriggerUser, task.Job, task) + } + if req.Msg.State.Result != runnerv1.Result_RESULT_UNSPECIFIED { if err := actions_service.EmitJobsIfReady(task.Job.RunID); err != nil { log.Error("Emit ready jobs of run %d: %v", task.Job.RunID, err) |