Skip to content

Commit dc3ee11

Browse files
fix for -1 in tailLines (#2047)
1 parent c38802a commit dc3ee11

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/buffer/buffer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const maxLineSize = 10 * 1024 * 1024
3232
// If the response contains more lines than maxJobLogLines, only the most recent lines are kept.
3333
// Lines exceeding maxLineSize are truncated with a marker.
3434
func ProcessResponseAsRingBufferToEnd(httpResp *http.Response, maxJobLogLines int) (string, int, *http.Response, error) {
35+
if maxJobLogLines <= 0 {
36+
maxJobLogLines = 500
37+
}
3538
if maxJobLogLines > 100000 {
3639
maxJobLogLines = 100000
3740
}

pkg/github/actions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ For single job logs, provide job_id. For all failed jobs in a run, provide run_i
702702
if err != nil {
703703
return utils.NewToolResultError(err.Error()), nil, nil
704704
}
705-
// Default to 500 lines if not specified
706-
if tailLines == 0 {
705+
// Default to 500 lines if not specified or invalid
706+
if tailLines <= 0 {
707707
tailLines = 500
708708
}
709709

0 commit comments

Comments
 (0)