Skip to content

Commit

Permalink
more consistent log statement
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Stettler <[email protected]>
  • Loading branch information
replay committed Aug 2, 2024
1 parent 584cc52 commit 13fad36
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/labeler/labeler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 13fad36

Please sign in to comment.