summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-29 11:53:46 +0800
committerUnknwon <u@gogs.io>2015-08-29 11:53:46 +0800
commit65843b803b9d08dcdeff9b32b823ecfbcb6ead32 (patch)
tree1827e2000ec100697a1275e4586d594ac9856641 /routers/api
parent55ddf225bb8aba269a407b1d13ab00a497df4f9b (diff)
downloadgitea-65843b803b9d08dcdeff9b32b823ecfbcb6ead32.tar.gz
gitea-65843b803b9d08dcdeff9b32b823ecfbcb6ead32.zip
add webhook default events
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo_hooks.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/api/v1/repo_hooks.go b/routers/api/v1/repo_hooks.go
index c7b59fc2bb..020ac7e2f2 100644
--- a/routers/api/v1/repo_hooks.go
+++ b/routers/api/v1/repo_hooks.go
@@ -76,6 +76,9 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
return
}
+ if len(form.Events) == 0 {
+ form.Events = []string{"push"}
+ }
w := &models.Webhook{
RepoID: ctx.Repo.Repository.ID,
URL: form.Config["url"],
@@ -159,6 +162,9 @@ func EditRepoHook(ctx *middleware.Context, form api.EditHookOption) {
}
// Update events
+ if len(form.Events) == 0 {
+ form.Events = []string{"push"}
+ }
w.PushOnly = false
w.SendEverything = false
w.ChooseEvents = true