mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 23:09:32 +02:00
wip event
This commit is contained in:
1 parent
cb6b33c9cd
commit
edb24592fc
10 files changed
+102
No files matched your search
@@ -125,6 +125,9 @@ func CancelAbandonedJobs(ctx context.Context) error {
|
||||
if updated {
|
||||
_ = job.LoadAttributes(ctx)
|
||||
notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil)
|
||||
if job.Run != nil {
|
||||
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ package actions
|
||||
import (
|
||||
"context"
|
||||
|
||||
actions_model "code.gitea.io/gitea/models/actions"
|
||||
issues_model "code.gitea.io/gitea/models/issues"
|
||||
packages_model "code.gitea.io/gitea/models/packages"
|
||||
perm_model "code.gitea.io/gitea/models/perm"
|
||||
@@ -762,3 +763,13 @@ func (n *actionsNotifier) MigrateRepository(ctx context.Context, doer, u *user_m
|
||||
Sender: convert.ToUser(ctx, doer, nil),
|
||||
}).Notify(ctx)
|
||||
}
|
||||
|
||||
func (n *actionsNotifier) WorkflowRunStatusUpdate(ctx context.Context, repo *repo_model.Repository, sender *user_model.User, run *actions_model.ActionRun) {
|
||||
run.Status.IsBlocked()
|
||||
newNotifyInput(repo, sender, webhook_module.HookEventWorkflowRun).WithPayload(&api.WorkflowRunPayload{
|
||||
Action: "queued",
|
||||
Repo: convert.ToRepo(ctx, repo, access_model.Permission{AccessMode: perm_model.AccessModeOwner}),
|
||||
Organization: nil,
|
||||
Sender: convert.ToUser(ctx, sender, nil),
|
||||
}).Notify(ctx)
|
||||
}
|
||||
Reference in new issue
Block a user