diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/actions/workflows.go | 16 | ||||
-rw-r--r-- | modules/public/public.go | 1 | ||||
-rw-r--r-- | modules/setting/markup.go | 2 |
3 files changed, 3 insertions, 16 deletions
diff --git a/modules/actions/workflows.go b/modules/actions/workflows.go index 5cdd45b046..e7677edc59 100644 --- a/modules/actions/workflows.go +++ b/modules/actions/workflows.go @@ -565,18 +565,12 @@ func matchPullRequestReviewEvent(prPayload *api.PullRequestPayload, evt *jobpars actions = append(actions, "submitted", "edited") } - matched := false for _, val := range vals { if slices.ContainsFunc(actions, glob.MustCompile(val, '/').Match) { - matched = true - } - if matched { + matchTimes++ break } } - if matched { - matchTimes++ - } default: log.Warn("pull request review event unsupported condition %q", cond) } @@ -611,18 +605,12 @@ func matchPullRequestReviewCommentEvent(prPayload *api.PullRequestPayload, evt * actions = append(actions, "created", "edited") } - matched := false for _, val := range vals { if slices.ContainsFunc(actions, glob.MustCompile(val, '/').Match) { - matched = true - } - if matched { + matchTimes++ break } } - if matched { - matchTimes++ - } default: log.Warn("pull request review comment event unsupported condition %q", cond) } diff --git a/modules/public/public.go b/modules/public/public.go index 9bc04f3f7e..a7eace1538 100644 --- a/modules/public/public.go +++ b/modules/public/public.go @@ -110,5 +110,4 @@ func servePublicAsset(w http.ResponseWriter, req *http.Request, fi os.FileInfo, } } http.ServeContent(w, req, fi.Name(), modtime, content) - return } diff --git a/modules/setting/markup.go b/modules/setting/markup.go index afaaaa2831..057b0650c3 100644 --- a/modules/setting/markup.go +++ b/modules/setting/markup.go @@ -149,7 +149,7 @@ func loadMarkupFrom(rootCfg ConfigProvider) { func newMarkupSanitizer(name string, sec ConfigSection) { rule, ok := createMarkupSanitizerRule(name, sec) if ok { - if after, ok0 := strings.CutPrefix(name, "sanitizer."); ok0 { + if after, found := strings.CutPrefix(name, "sanitizer."); found { names := strings.SplitN(after, ".", 2) name = names[0] } |