From 9c1913a627af8b2f711b8f77d5f6d170d58dee49 Mon Sep 17 00:00:00 2001 From: JoannaaKL Date: Tue, 1 Jul 2025 09:49:52 +0200 Subject: [PATCH] Add comment to trim lines --- pkg/github/actions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/github/actions.go b/pkg/github/actions.go index 0fa49bac7..8c7b08a85 100644 --- a/pkg/github/actions.go +++ b/pkg/github/actions.go @@ -799,10 +799,11 @@ func trimContent(content string, tailLines int) (string, int) { lineCount := 0 if tailLines > 0 { - // Count backwards to find the nth newline from the end + // Count backwards to find the nth newline from the end and a total number of lines for i := len(content) - 1; i >= 0 && lineCount < tailLines; i-- { if content[i] == '\n' { lineCount++ + // If we have reached the tailLines, trim the content if lineCount == tailLines { content = content[i+1:] }