@@ -103,11 +103,6 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
103
103
return false
104
104
}
105
105
106
- // with no special filter parameters
107
- if len (evt .Acts ) == 0 {
108
- return true
109
- }
110
-
111
106
switch triggedEvent {
112
107
case webhook_module .HookEventCreate ,
113
108
webhook_module .HookEventDelete ,
@@ -126,6 +121,9 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
126
121
webhook_module .HookEventRepository ,
127
122
webhook_module .HookEventRelease ,
128
123
webhook_module .HookEventPackage :
124
+ if len (evt .Acts ) != 0 {
125
+ log .Warn ("Ignore unsupported %s event arguments %q" , triggedEvent , evt .Acts )
126
+ }
129
127
// no special filter parameters for these events, just return true if name matched
130
128
return true
131
129
@@ -142,12 +140,17 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
142
140
return matchIssueCommentEvent (commit , payload .(* api.IssueCommentPayload ), evt )
143
141
144
142
default :
145
- log .Warn ("unsupported event %q" , triggedEvent . Event () )
143
+ log .Warn ("unsupported event %q" , triggedEvent )
146
144
return false
147
145
}
148
146
}
149
147
150
148
func matchPushEvent (commit * git.Commit , pushPayload * api.PushPayload , evt * jobparser.Event ) bool {
149
+ // with no special filter parameters
150
+ if len (evt .Acts ) == 0 {
151
+ return true
152
+ }
153
+
151
154
matchTimes := 0
152
155
// all acts conditions should be satisfied
153
156
for cond , vals := range evt .Acts {
@@ -180,13 +183,18 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
180
183
}
181
184
}
182
185
default :
183
- log .Warn ("unsupported condition %q" , cond )
186
+ log .Warn ("push event unsupported condition %q" , cond )
184
187
}
185
188
}
186
189
return matchTimes == len (evt .Acts )
187
190
}
188
191
189
192
func matchIssuesEvent (commit * git.Commit , issuePayload * api.IssuePayload , evt * jobparser.Event ) bool {
193
+ // with no special filter parameters
194
+ if len (evt .Acts ) == 0 {
195
+ return true
196
+ }
197
+
190
198
matchTimes := 0
191
199
// all acts conditions should be satisfied
192
200
for cond , vals := range evt .Acts {
@@ -199,13 +207,19 @@ func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *j
199
207
}
200
208
}
201
209
default :
202
- log .Warn ("unsupported condition %q" , cond )
210
+ log .Warn ("issue event unsupported condition %q" , cond )
203
211
}
204
212
}
205
213
return matchTimes == len (evt .Acts )
206
214
}
207
215
208
216
func matchPullRequestEvent (commit * git.Commit , prPayload * api.PullRequestPayload , evt * jobparser.Event ) bool {
217
+ // with no special filter parameters
218
+ if len (evt .Acts ) == 0 {
219
+ // defautly, only pull request opened and synchronized will not trigger workflow
220
+ return prPayload .Action == api .HookIssueSynchronized || prPayload .Action == api .HookIssueOpened
221
+ }
222
+
209
223
matchTimes := 0
210
224
// all acts conditions should be satisfied
211
225
for cond , vals := range evt .Acts {
@@ -250,13 +264,18 @@ func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload
250
264
}
251
265
}
252
266
default :
253
- log .Warn ("unsupported condition %q" , cond )
267
+ log .Warn ("pull request event unsupported condition %q" , cond )
254
268
}
255
269
}
256
270
return matchTimes == len (evt .Acts )
257
271
}
258
272
259
273
func matchIssueCommentEvent (commit * git.Commit , issueCommentPayload * api.IssueCommentPayload , evt * jobparser.Event ) bool {
274
+ // with no special filter parameters
275
+ if len (evt .Acts ) == 0 {
276
+ return true
277
+ }
278
+
260
279
matchTimes := 0
261
280
// all acts conditions should be satisfied
262
281
for cond , vals := range evt .Acts {
@@ -269,7 +288,7 @@ func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCo
269
288
}
270
289
}
271
290
default :
272
- log .Warn ("unsupported condition %q" , cond )
291
+ log .Warn ("issue comment unsupported condition %q" , cond )
273
292
}
274
293
}
275
294
return matchTimes == len (evt .Acts )
0 commit comments