From 1c390093f8dc365af0653467461817c05bf0f090 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 16 Sep 2024 16:52:03 +0100 Subject: [PATCH] Revert "Limit usage of GitHub Actions Annotations" --- Library/Homebrew/extend/kernel.rb | 14 ++++---------- Library/Homebrew/utils/github/actions.rb | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Library/Homebrew/extend/kernel.rb b/Library/Homebrew/extend/kernel.rb index 465e76e895323..90481e28bc324 100644 --- a/Library/Homebrew/extend/kernel.rb +++ b/Library/Homebrew/extend/kernel.rb @@ -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 @@ -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 diff --git a/Library/Homebrew/utils/github/actions.rb b/Library/Homebrew/utils/github/actions.rb index 116795279db5e..c2026dfdc392c 100644 --- a/Library/Homebrew/utils/github/actions.rb +++ b/Library/Homebrew/utils/github/actions.rb @@ -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.