mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-21 05:54:38 +02:00
wip
This commit is contained in:
parent
c3f6f13377
commit
ca6bbc6c6d
@ -73,7 +73,7 @@ func TestWebhook_EventsArray(t *testing.T) {
|
||||
"pull_request", "pull_request_assign", "pull_request_label", "pull_request_milestone",
|
||||
"pull_request_comment", "pull_request_review_approved", "pull_request_review_rejected",
|
||||
"pull_request_review_comment", "pull_request_sync", "pull_request_review_request", "wiki", "repository", "release",
|
||||
"package", "status", "workflow_job",
|
||||
"package", "status", "workflow_run", "workflow_job",
|
||||
},
|
||||
(&Webhook{
|
||||
HookEvent: &webhook_module.HookEvent{SendEverything: true},
|
||||
|
@ -68,6 +68,7 @@ func AllEvents() []HookEventType {
|
||||
HookEventRelease,
|
||||
HookEventPackage,
|
||||
HookEventStatus,
|
||||
HookEventWorkflowRun,
|
||||
HookEventWorkflowJob,
|
||||
}
|
||||
}
|
||||
|
@ -207,6 +207,7 @@ func addHook(ctx *context.APIContext, form *api.CreateHookOption, ownerID, repoI
|
||||
webhook_module.HookEventRelease: util.SliceContainsString(form.Events, string(webhook_module.HookEventRelease), true),
|
||||
webhook_module.HookEventPackage: util.SliceContainsString(form.Events, string(webhook_module.HookEventPackage), true),
|
||||
webhook_module.HookEventStatus: util.SliceContainsString(form.Events, string(webhook_module.HookEventStatus), true),
|
||||
webhook_module.HookEventWorkflowRun: util.SliceContainsString(form.Events, string(webhook_module.HookEventWorkflowRun), true),
|
||||
webhook_module.HookEventWorkflowJob: util.SliceContainsString(form.Events, string(webhook_module.HookEventWorkflowJob), true),
|
||||
},
|
||||
BranchFilter: form.BranchFilter,
|
||||
|
@ -185,6 +185,7 @@ func ParseHookEvent(form forms.WebhookForm) *webhook_module.HookEvent {
|
||||
webhook_module.HookEventRepository: form.Repository,
|
||||
webhook_module.HookEventPackage: form.Package,
|
||||
webhook_module.HookEventStatus: form.Status,
|
||||
webhook_module.HookEventWorkflowRun: form.WorkflowRun,
|
||||
webhook_module.HookEventWorkflowJob: form.WorkflowJob,
|
||||
},
|
||||
BranchFilter: form.BranchFilter,
|
||||
|
@ -237,6 +237,7 @@ type WebhookForm struct {
|
||||
Release bool
|
||||
Package bool
|
||||
Status bool
|
||||
WorkflowRun bool
|
||||
WorkflowJob bool
|
||||
Active bool
|
||||
BranchFilter string `binding:"GlobPattern"`
|
||||
|
@ -81,6 +81,8 @@ func newPayload[T any](rc payloadConvertor[T], data []byte, event webhook_module
|
||||
return convertUnmarshalledJSON(rc.Package, data)
|
||||
case webhook_module.HookEventStatus:
|
||||
return convertUnmarshalledJSON(rc.Status, data)
|
||||
// case webhook_module.HookEventWorkflowRun:
|
||||
// return convertUnmarshalledJSON(rc.WorkflowRun, data)
|
||||
case webhook_module.HookEventWorkflowJob:
|
||||
return convertUnmarshalledJSON(rc.WorkflowJob, data)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user