@@ -106,8 +106,8 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
106
106
webhook_module .HookEventRepository ,
107
107
webhook_module .HookEventRelease ,
108
108
webhook_module .HookEventPackage :
109
- if len (evt .Acts ) != 0 {
110
- log .Warn ("Ignore unsupported %s event arguments %q " , triggedEvent , evt .Acts )
109
+ if len (evt .Acts () ) != 0 {
110
+ log .Warn ("Ignore unsupported %s event arguments %v " , triggedEvent , evt .Acts () )
111
111
}
112
112
// no special filter parameters for these events, just return true if name matched
113
113
return true
@@ -132,7 +132,7 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
132
132
133
133
func matchPushEvent (commit * git.Commit , pushPayload * api.PushPayload , evt * jobparser.Event ) bool {
134
134
// with no special filter parameters
135
- if len (evt .Acts ) == 0 {
135
+ if len (evt .Acts () ) == 0 {
136
136
return true
137
137
}
138
138
@@ -141,7 +141,7 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
141
141
hasTagFilter := false
142
142
refName := git .RefName (pushPayload .Ref )
143
143
// all acts conditions should be satisfied
144
- for cond , vals := range evt .Acts {
144
+ for cond , vals := range evt .Acts () {
145
145
switch cond {
146
146
case "branches" :
147
147
hasBranchFilter = true
@@ -225,18 +225,18 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
225
225
if hasBranchFilter && hasTagFilter {
226
226
matchTimes ++
227
227
}
228
- return matchTimes == len (evt .Acts )
228
+ return matchTimes == len (evt .Acts () )
229
229
}
230
230
231
231
func matchIssuesEvent (commit * git.Commit , issuePayload * api.IssuePayload , evt * jobparser.Event ) bool {
232
232
// with no special filter parameters
233
- if len (evt .Acts ) == 0 {
233
+ if len (evt .Acts () ) == 0 {
234
234
return true
235
235
}
236
236
237
237
matchTimes := 0
238
238
// all acts conditions should be satisfied
239
- for cond , vals := range evt .Acts {
239
+ for cond , vals := range evt .Acts () {
240
240
switch cond {
241
241
case "types" :
242
242
for _ , val := range vals {
@@ -249,19 +249,19 @@ func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *j
249
249
log .Warn ("issue event unsupported condition %q" , cond )
250
250
}
251
251
}
252
- return matchTimes == len (evt .Acts )
252
+ return matchTimes == len (evt .Acts () )
253
253
}
254
254
255
255
func matchPullRequestEvent (commit * git.Commit , prPayload * api.PullRequestPayload , evt * jobparser.Event ) bool {
256
256
// with no special filter parameters
257
- if len (evt .Acts ) == 0 {
257
+ if len (evt .Acts () ) == 0 {
258
258
// defaultly, only pull request opened and synchronized will trigger workflow
259
259
return prPayload .Action == api .HookIssueSynchronized || prPayload .Action == api .HookIssueOpened
260
260
}
261
261
262
262
matchTimes := 0
263
263
// all acts conditions should be satisfied
264
- for cond , vals := range evt .Acts {
264
+ for cond , vals := range evt .Acts () {
265
265
switch cond {
266
266
case "types" :
267
267
action := prPayload .Action
@@ -323,18 +323,18 @@ func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload
323
323
log .Warn ("pull request event unsupported condition %q" , cond )
324
324
}
325
325
}
326
- return matchTimes == len (evt .Acts )
326
+ return matchTimes == len (evt .Acts () )
327
327
}
328
328
329
329
func matchIssueCommentEvent (commit * git.Commit , issueCommentPayload * api.IssueCommentPayload , evt * jobparser.Event ) bool {
330
330
// with no special filter parameters
331
- if len (evt .Acts ) == 0 {
331
+ if len (evt .Acts () ) == 0 {
332
332
return true
333
333
}
334
334
335
335
matchTimes := 0
336
336
// all acts conditions should be satisfied
337
- for cond , vals := range evt .Acts {
337
+ for cond , vals := range evt .Acts () {
338
338
switch cond {
339
339
case "types" :
340
340
for _ , val := range vals {
@@ -347,5 +347,5 @@ func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCo
347
347
log .Warn ("issue comment unsupported condition %q" , cond )
348
348
}
349
349
}
350
- return matchTimes == len (evt .Acts )
350
+ return matchTimes == len (evt .Acts () )
351
351
}
0 commit comments