dev-cmd/audit: fix audit annotations

Emitting annotations currently produces:

    Error: no implicit conversion of Symbol into Integer

The issue is that `problem` is an `Array` of problems which we need to
handle individually.
This commit is contained in:
Carlo Cabrera 2023-04-22 15:13:35 +08:00
parent ec39fe7bb1
commit f4692ddb40
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -309,16 +309,16 @@ module Homebrew
return unless ENV["GITHUB_ACTIONS"]
annotations = formula_results.merge(cask_results).flat_map do |path, problem|
next if problem.blank?
GitHub::Actions::Annotation.new(
:error,
problem[:message],
file: path,
line: problem[:location]&.line,
column: problem[:location]&.column,
)
annotations = formula_results.merge(cask_results).flat_map do |path, problems|
problems.map do |problem|
GitHub::Actions::Annotation.new(
:error,
problem[:message],
file: path,
line: problem[:location]&.line,
column: problem[:location]&.column,
)
end
end.compact
annotations.each do |annotation|