diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/utils/hook.go | 2 | ||||
-rw-r--r-- | routers/repo/webhook.go | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/routers/api/v1/utils/hook.go b/routers/api/v1/utils/hook.go index 0b00e59ade..7903d58334 100644 --- a/routers/api/v1/utils/hook.go +++ b/routers/api/v1/utils/hook.go @@ -112,6 +112,7 @@ func addHook(ctx *context.APIContext, form *api.CreateHookOption, orgID, repoID Repository: com.IsSliceContainsStr(form.Events, string(models.HookEventRepository)), Release: com.IsSliceContainsStr(form.Events, string(models.HookEventRelease)), }, + BranchFilter: form.BranchFilter, }, IsActive: form.Active, HookTaskType: models.ToHookTaskType(form.Type), @@ -236,6 +237,7 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *models.Webho w.PullRequest = com.IsSliceContainsStr(form.Events, string(models.HookEventPullRequest)) w.Repository = com.IsSliceContainsStr(form.Events, string(models.HookEventRepository)) w.Release = com.IsSliceContainsStr(form.Events, string(models.HookEventRelease)) + w.BranchFilter = form.BranchFilter if err := w.UpdateEvent(); err != nil { ctx.Error(500, "UpdateEvent", err) diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index d523fd9e87..0711270cb9 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -145,6 +145,7 @@ func ParseHookEvent(form auth.WebhookForm) *models.HookEvent { PullRequest: form.PullRequest, Repository: form.Repository, }, + BranchFilter: form.BranchFilter, } } |