Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Limit usage of GitHub Actions Annotations" #18340

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
MikeMcQuaid marked this conversation as resolved.
Show resolved Hide resolved
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)
MikeMcQuaid marked this conversation as resolved.
Show resolved Hide resolved
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 @@
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
MikeMcQuaid marked this conversation as resolved.
Show resolved Hide resolved
end

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