Skip to content

Commit 721fd3e

Browse files
authored
Add comment to trim lines (#621)
1 parent b44dee6 commit 721fd3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/github/actions.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,11 @@ func trimContent(content string, tailLines int) (string, int) {
799799
lineCount := 0
800800
if tailLines > 0 {
801801

802-
// Count backwards to find the nth newline from the end
802+
// Count backwards to find the nth newline from the end and a total number of lines
803803
for i := len(content) - 1; i >= 0 && lineCount < tailLines; i-- {
804804
if content[i] == '\n' {
805805
lineCount++
806+
// If we have reached the tailLines, trim the content
806807
if lineCount == tailLines {
807808
content = content[i+1:]
808809
}

0 commit comments

Comments
 (0)