Skip to content

Commit 8fff804

Browse files
committed
improvements
1 parent ef4a41b commit 8fff804

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

modules/actions/workflows.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -565,16 +565,12 @@ func matchPullRequestReviewEvent(prPayload *api.PullRequestPayload, evt *jobpars
565565
actions = append(actions, "submitted", "edited")
566566
}
567567

568-
matched := false
569568
for _, val := range vals {
570569
if slices.ContainsFunc(actions, glob.MustCompile(val, '/').Match) {
571-
matched = true
570+
matchTimes++
572571
break
573572
}
574573
}
575-
if matched {
576-
matchTimes++
577-
}
578574
default:
579575
log.Warn("pull request review event unsupported condition %q", cond)
580576
}
@@ -609,16 +605,12 @@ func matchPullRequestReviewCommentEvent(prPayload *api.PullRequestPayload, evt *
609605
actions = append(actions, "created", "edited")
610606
}
611607

612-
matched := false
613608
for _, val := range vals {
614609
if slices.ContainsFunc(actions, glob.MustCompile(val, '/').Match) {
615-
matched = true
610+
matchTimes++
616611
break
617612
}
618613
}
619-
if matched {
620-
matchTimes++
621-
}
622614
default:
623615
log.Warn("pull request review comment event unsupported condition %q", cond)
624616
}

0 commit comments

Comments
 (0)