From 2f25e1f03e5a152381668f94fd1fb3357e4129e4 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 13 Sep 2020 23:45:28 +0200 Subject: [PATCH] Strip escape codes from annotations. --- Library/Homebrew/utils/github/actions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/utils/github/actions.rb b/Library/Homebrew/utils/github/actions.rb index e61d5f32d4..111a9d6ab2 100644 --- a/Library/Homebrew/utils/github/actions.rb +++ b/Library/Homebrew/utils/github/actions.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "utils/tty" + module GitHub # Helper functions for interacting with GitHub Actions. # @@ -26,7 +28,7 @@ module GitHub raise ArgumentError, "Unsupported type: #{type.inspect}" unless [:warning, :error].include?(type) @type = type - @message = String(message) + @message = Tty.strip_ansi(message) @file = self.class.path_relative_to_workspace(file) if file @line = Integer(line) if line @column = Integer(column) if column