From 13fad36e66816a857d9602df19fe294ed99dd725 Mon Sep 17 00:00:00 2001 From: Mauro Stettler Date: Fri, 2 Aug 2024 10:03:49 +0200 Subject: [PATCH] more consistent log statement Signed-off-by: Mauro Stettler --- pkg/labeler/labeler.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/labeler/labeler.go b/pkg/labeler/labeler.go index 73344c5..fd62608 100644 --- a/pkg/labeler/labeler.go +++ b/pkg/labeler/labeler.go @@ -44,10 +44,11 @@ func NewLabeler(cfg Config, gh *github.Client, logger log.Logger) *Labeler { func (l *Labeler) Run(issue *github.Issue) error { if !l.hasRequiredLabels(issue) { + level.Info(l.logger).Log("msg", "issue has none of the required labels", "requireLabel", strings.Join(l.cfg.RequireLabel, ", ")) return nil } - level.Info(l.logger).Log("msg", "issue has the required labels", "required_labels", strings.Join(l.cfg.RequireLabel, ", ")) + level.Info(l.logger).Log("msg", "issue has at least one of the required labels", "requireLabel", strings.Join(l.cfg.RequireLabel, ", ")) if l.hasAssignableLabel(issue) { return nil @@ -163,9 +164,5 @@ func (l *Labeler) hasRequiredLabels(issue *github.Issue) bool { } - if !match { - level.Info(l.logger).Log("msg", "issue has none of the required labels", "requireLabel", strings.Join(l.cfg.RequireLabel, ",")) - } - return match }