aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/forms/repo_form.go11
-rw-r--r--services/webhook/webhook.go10
2 files changed, 4 insertions, 17 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go
index 4f9806dc93..1a1c6585db 100644
--- a/services/forms/repo_form.go
+++ b/services/forms/repo_form.go
@@ -219,26 +219,18 @@ type ProtectBranchPriorityForm struct {
IDs []int64
}
-// __ __ ___. .__ __
-// / \ / \ ____\_ |__ | |__ ____ ____ | | __
-// \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
-// \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
-// \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
-// \/ \/ \/ \/ \/
-
// WebhookForm form for changing web hook
type WebhookForm struct {
Events string
Create bool
Delete bool
Fork bool
+ Push bool
Issues bool
IssueAssign bool
IssueLabel bool
IssueMilestone bool
IssueComment bool
- Release bool
- Push bool
PullRequest bool
PullRequestAssign bool
PullRequestLabel bool
@@ -249,6 +241,7 @@ type WebhookForm struct {
PullRequestReviewRequest bool
Wiki bool
Repository bool
+ Release bool
Package bool
Active bool
BranchFilter string `binding:"GlobPattern"`
diff --git a/services/webhook/webhook.go b/services/webhook/webhook.go
index e0e8fa2fc1..b4609e8a51 100644
--- a/services/webhook/webhook.go
+++ b/services/webhook/webhook.go
@@ -137,14 +137,8 @@ func PrepareWebhook(ctx context.Context, w *webhook_model.Webhook, event webhook
return nil
}
- for _, e := range w.EventCheckers() {
- if event == e.Type {
- if !e.Has() {
- return nil
- }
-
- break
- }
+ if !w.HasEvent(event) {
+ return nil
}
// Avoid sending "0 new commits" to non-integration relevant webhooks (e.g. slack, discord, etc.).