From 0cbdbd36b66c7216db18a269b46c6b5a485b6184 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Fri, 2 Dec 2022 16:07:23 +0800 Subject: [PATCH] Trim newline in log message (#6) Co-authored-by: Jason Song Reviewed-on: https://gitea.com/gitea/act_runner/pulls/6 --- runtime/reporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/reporter.go b/runtime/reporter.go index 692e709..f03c7df 100644 --- a/runtime/reporter.go +++ b/runtime/reporter.go @@ -285,7 +285,7 @@ func (r *Reporter) parseResult(result interface{}) (runnerv1.Result, bool) { } func (r *Reporter) parseLogRow(entry *log.Entry) *runnerv1.LogRow { - content := strings.TrimSuffix(entry.Message, "\r\n") + content := strings.TrimRightFunc(entry.Message, func(r rune) bool { return r == '\r' || r == '\n' }) content = r.logReplacer.Replace(content) return &runnerv1.LogRow{ Time: timestamppb.New(entry.Time),