Skip to content

Commit

Permalink
Merge pull request #18340 from Homebrew/revert-18329-limit-annotations
Browse files Browse the repository at this point in the history
Revert "Limit usage of GitHub Actions Annotations"
  • Loading branch information
MikeMcQuaid authored Sep 16, 2024
2 parents 547677c + 1c39009 commit 08e5122
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)
end

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

0 comments on commit 08e5122

Please sign in to comment.