Add comment to trim lines (#621) · github/github-mcp-server@721fd3e · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
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)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.