@@ -122,8 +122,8 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
122122 webhook_module .HookEventRepository ,
123123 webhook_module .HookEventRelease ,
124124 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 () )
127127 }
128128 // no special filter parameters for these events, just return true if name matched
129129 return true
@@ -148,7 +148,7 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
148148
149149func matchPushEvent (commit * git.Commit , pushPayload * api.PushPayload , evt * jobparser.Event ) bool {
150150 // with no special filter parameters
151- if len (evt .Acts ) == 0 {
151+ if len (evt .Acts () ) == 0 {
152152 return true
153153 }
154154
@@ -157,7 +157,7 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
157157 hasTagFilter := false
158158 refName := git .RefName (pushPayload .Ref )
159159 // all acts conditions should be satisfied
160- for cond , vals := range evt .Acts {
160+ for cond , vals := range evt .Acts () {
161161 switch cond {
162162 case "branches" :
163163 hasBranchFilter = true
@@ -241,18 +241,18 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
241241 if hasBranchFilter && hasTagFilter {
242242 matchTimes ++
243243 }
244- return matchTimes == len (evt .Acts )
244+ return matchTimes == len (evt .Acts () )
245245}
246246
247247func matchIssuesEvent (commit * git.Commit , issuePayload * api.IssuePayload , evt * jobparser.Event ) bool {
248248 // with no special filter parameters
249- if len (evt .Acts ) == 0 {
249+ if len (evt .Acts () ) == 0 {
250250 return true
251251 }
252252
253253 matchTimes := 0
254254 // all acts conditions should be satisfied
255- for cond , vals := range evt .Acts {
255+ for cond , vals := range evt .Acts () {
256256 switch cond {
257257 case "types" :
258258 for _ , val := range vals {
@@ -265,19 +265,19 @@ func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *j
265265 log .Warn ("issue event unsupported condition %q" , cond )
266266 }
267267 }
268- return matchTimes == len (evt .Acts )
268+ return matchTimes == len (evt .Acts () )
269269}
270270
271271func matchPullRequestEvent (commit * git.Commit , prPayload * api.PullRequestPayload , evt * jobparser.Event ) bool {
272272 // with no special filter parameters
273- if len (evt .Acts ) == 0 {
273+ if len (evt .Acts () ) == 0 {
274274 // defaultly, only pull request opened and synchronized will trigger workflow
275275 return prPayload .Action == api .HookIssueSynchronized || prPayload .Action == api .HookIssueOpened
276276 }
277277
278278 matchTimes := 0
279279 // all acts conditions should be satisfied
280- for cond , vals := range evt .Acts {
280+ for cond , vals := range evt .Acts () {
281281 switch cond {
282282 case "types" :
283283 action := prPayload .Action
@@ -339,18 +339,18 @@ func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload
339339 log .Warn ("pull request event unsupported condition %q" , cond )
340340 }
341341 }
342- return matchTimes == len (evt .Acts )
342+ return matchTimes == len (evt .Acts () )
343343}
344344
345345func matchIssueCommentEvent (commit * git.Commit , issueCommentPayload * api.IssueCommentPayload , evt * jobparser.Event ) bool {
346346 // with no special filter parameters
347- if len (evt .Acts ) == 0 {
347+ if len (evt .Acts () ) == 0 {
348348 return true
349349 }
350350
351351 matchTimes := 0
352352 // all acts conditions should be satisfied
353- for cond , vals := range evt .Acts {
353+ for cond , vals := range evt .Acts () {
354354 switch cond {
355355 case "types" :
356356 for _ , val := range vals {
@@ -363,5 +363,5 @@ func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCo
363363 log .Warn ("issue comment unsupported condition %q" , cond )
364364 }
365365 }
366- return matchTimes == len (evt .Acts )
366+ return matchTimes == len (evt .Acts () )
367367}
0 commit comments