Skip to content

Commit

Permalink
fix logging for codeowners rule matching
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jan 8, 2024
1 parent 15d853c commit 8e59911
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/datadog/ci/codeowners/matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ def list_owners(file_path)
Datadog.logger.debug { "Matching file path #{file_path} to CODEOWNERS rules" }

@rules.each do |rule|
Datadog.logger.debug { "Matched rule [#{rule.pattern}] with owners #{rule.owners}" }
return rule.owners if rule.match?(file_path)
if rule.match?(file_path)
Datadog.logger.debug { "Matched rule [#{rule.pattern}] with owners #{rule.owners}" }
return rule.owners
end
end

Datadog.logger.debug { "CODEOWNERS rule not matched" }
Expand Down

0 comments on commit 8e59911

Please sign in to comment.