@@ -245,18 +245,29 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *webhook.Webh
245
245
w .ChooseEvents = true
246
246
w .Create = util .IsStringInSlice (string (webhook .HookEventCreate ), form .Events , true )
247
247
w .Push = util .IsStringInSlice (string (webhook .HookEventPush ), form .Events , true )
248
- w .PullRequest = util .IsStringInSlice (string (webhook .HookEventPullRequest ), form .Events , true )
249
248
w .Create = util .IsStringInSlice (string (webhook .HookEventCreate ), form .Events , true )
250
249
w .Delete = util .IsStringInSlice (string (webhook .HookEventDelete ), form .Events , true )
251
250
w .Fork = util .IsStringInSlice (string (webhook .HookEventFork ), form .Events , true )
252
- w .Issues = util .IsStringInSlice (string (webhook .HookEventIssues ), form .Events , true )
253
- w .IssueComment = util .IsStringInSlice (string (webhook .HookEventIssueComment ), form .Events , true )
254
- w .Push = util .IsStringInSlice (string (webhook .HookEventPush ), form .Events , true )
255
- w .PullRequest = util .IsStringInSlice (string (webhook .HookEventPullRequest ), form .Events , true )
256
251
w .Repository = util .IsStringInSlice (string (webhook .HookEventRepository ), form .Events , true )
257
252
w .Release = util .IsStringInSlice (string (webhook .HookEventRelease ), form .Events , true )
258
253
w .BranchFilter = form .BranchFilter
259
254
255
+ // Issues
256
+ w .Issues = issuesHook (form .Events , "issues_only" )
257
+ w .IssueAssign = issuesHook (form .Events , string (webhook .HookEventIssueAssign ))
258
+ w .IssueLabel = issuesHook (form .Events , string (webhook .HookEventIssueLabel ))
259
+ w .IssueMilestone = issuesHook (form .Events , string (webhook .HookEventIssueMilestone ))
260
+ w .IssueComment = issuesHook (form .Events , string (webhook .HookEventIssueComment ))
261
+
262
+ // Pull requests
263
+ w .PullRequest = pullHook (form .Events , "pull_request_only" )
264
+ w .PullRequestAssign = pullHook (form .Events , string (webhook .HookEventPullRequestAssign ))
265
+ w .PullRequestLabel = pullHook (form .Events , string (webhook .HookEventPullRequestLabel ))
266
+ w .PullRequestMilestone = pullHook (form .Events , string (webhook .HookEventPullRequestMilestone ))
267
+ w .PullRequestComment = pullHook (form .Events , string (webhook .HookEventPullRequestComment ))
268
+ w .PullRequestReview = pullHook (form .Events , "pull_request_review" )
269
+ w .PullRequestSync = pullHook (form .Events , string (webhook .HookEventPullRequestSync ))
270
+
260
271
if err := w .UpdateEvent (); err != nil {
261
272
ctx .Error (http .StatusInternalServerError , "UpdateEvent" , err )
262
273
return false
0 commit comments