@@ -122,8 +122,8 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
122
122
webhook_module .HookEventRepository ,
123
123
webhook_module .HookEventRelease ,
124
124
webhook_module .HookEventPackage :
125
- if len (evt .Acts ) != 0 {
126
- log .Warn ("Ignore unsupported %s event arguments %q " , triggedEvent , evt .Acts )
125
+ if len (evt .Acts () ) != 0 {
126
+ log .Warn ("Ignore unsupported %s event arguments %v " , triggedEvent , evt .Acts () )
127
127
}
128
128
// no special filter parameters for these events, just return true if name matched
129
129
return true
@@ -148,7 +148,7 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
148
148
149
149
func matchPushEvent (commit * git.Commit , pushPayload * api.PushPayload , evt * jobparser.Event ) bool {
150
150
// with no special filter parameters
151
- if len (evt .Acts ) == 0 {
151
+ if len (evt .Acts () ) == 0 {
152
152
return true
153
153
}
154
154
@@ -157,7 +157,7 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
157
157
hasTagFilter := false
158
158
refName := git .RefName (pushPayload .Ref )
159
159
// all acts conditions should be satisfied
160
- for cond , vals := range evt .Acts {
160
+ for cond , vals := range evt .Acts () {
161
161
switch cond {
162
162
case "branches" :
163
163
hasBranchFilter = true
@@ -241,18 +241,18 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
241
241
if hasBranchFilter && hasTagFilter {
242
242
matchTimes ++
243
243
}
244
- return matchTimes == len (evt .Acts )
244
+ return matchTimes == len (evt .Acts () )
245
245
}
246
246
247
247
func matchIssuesEvent (commit * git.Commit , issuePayload * api.IssuePayload , evt * jobparser.Event ) bool {
248
248
// with no special filter parameters
249
- if len (evt .Acts ) == 0 {
249
+ if len (evt .Acts () ) == 0 {
250
250
return true
251
251
}
252
252
253
253
matchTimes := 0
254
254
// all acts conditions should be satisfied
255
- for cond , vals := range evt .Acts {
255
+ for cond , vals := range evt .Acts () {
256
256
switch cond {
257
257
case "types" :
258
258
for _ , val := range vals {
@@ -265,19 +265,19 @@ func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *j
265
265
log .Warn ("issue event unsupported condition %q" , cond )
266
266
}
267
267
}
268
- return matchTimes == len (evt .Acts )
268
+ return matchTimes == len (evt .Acts () )
269
269
}
270
270
271
271
func matchPullRequestEvent (commit * git.Commit , prPayload * api.PullRequestPayload , evt * jobparser.Event ) bool {
272
272
// with no special filter parameters
273
- if len (evt .Acts ) == 0 {
273
+ if len (evt .Acts () ) == 0 {
274
274
// defaultly, only pull request opened and synchronized will trigger workflow
275
275
return prPayload .Action == api .HookIssueSynchronized || prPayload .Action == api .HookIssueOpened
276
276
}
277
277
278
278
matchTimes := 0
279
279
// all acts conditions should be satisfied
280
- for cond , vals := range evt .Acts {
280
+ for cond , vals := range evt .Acts () {
281
281
switch cond {
282
282
case "types" :
283
283
action := prPayload .Action
@@ -339,18 +339,18 @@ func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload
339
339
log .Warn ("pull request event unsupported condition %q" , cond )
340
340
}
341
341
}
342
- return matchTimes == len (evt .Acts )
342
+ return matchTimes == len (evt .Acts () )
343
343
}
344
344
345
345
func matchIssueCommentEvent (commit * git.Commit , issueCommentPayload * api.IssueCommentPayload , evt * jobparser.Event ) bool {
346
346
// with no special filter parameters
347
- if len (evt .Acts ) == 0 {
347
+ if len (evt .Acts () ) == 0 {
348
348
return true
349
349
}
350
350
351
351
matchTimes := 0
352
352
// all acts conditions should be satisfied
353
- for cond , vals := range evt .Acts {
353
+ for cond , vals := range evt .Acts () {
354
354
switch cond {
355
355
case "types" :
356
356
for _ , val := range vals {
@@ -363,5 +363,5 @@ func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCo
363
363
log .Warn ("issue comment unsupported condition %q" , cond )
364
364
}
365
365
}
366
- return matchTimes == len (evt .Acts )
366
+ return matchTimes == len (evt .Acts () )
367
367
}
0 commit comments