Skip to content

Commit

Permalink
Revert "Limit usage of GitHub Actions Annotations"
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Sep 16, 2024
1 parent 051069c commit 1c39009
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions Library/Homebrew/extend/kernel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ def oh1(title, truncate: :auto)
sig { params(message: T.any(String, Exception)).void }
def opoo(message)
Tty.with($stderr) do |stderr|
if ENV["HOMEBREW_GITHUB_ACTIONS"].present?
GitHub::Actions.puts_annotation_if_env_set(:warning, message.to_s)
else
stderr.puts Formatter.warning(message, label: "Warning")
end
stderr.puts Formatter.warning(message, label: "Warning")
GitHub::Actions.puts_annotation_if_env_set(:warning, message.to_s)
end
end

Expand All @@ -82,11 +79,8 @@ def onoe(message)
require "utils/github/actions"

Tty.with($stderr) do |stderr|
if ENV["HOMEBREW_GITHUB_ACTIONS"].present?
GitHub::Actions.puts_annotation_if_env_set(:error, message.to_s)
else
stderr.puts Formatter.error(message, label: "Error")
end
stderr.puts Formatter.error(message, label: "Error")
GitHub::Actions.puts_annotation_if_env_set(:error, message.to_s)
end
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/github/actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def self.puts_annotation_if_env_set(type, message, file: nil, line: nil)
return unless env_set?

std = (type == :notice) ? $stdout : $stderr
std.puts Annotation.new(type, message, file:, line:)
std.puts Annotation.new(type, message)

Check warning on line 54 in Library/Homebrew/utils/github/actions.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/utils/github/actions.rb#L54

Added line #L54 was not covered by tests
end

# Helper class for formatting annotations on GitHub Actions.
Expand Down

0 comments on commit 1c39009

Please sign in to comment.