Skip to content

Commit d5a1a09

Browse files
fix: GITHUB_ENV and GITHUB_OUTPUT allow larger lines (#112)
* Specify larger buffer
1 parent 9d4a12f commit d5a1a09

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

cmd/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ func readArgsFile(file string, split bool) []string {
287287
}
288288
}()
289289
scanner := bufio.NewScanner(f)
290+
scanner.Buffer(nil, 1024*1024*1024) // increase buffer to 1GB to avoid scanner buffer overflow
290291
for scanner.Scan() {
291292
arg := os.ExpandEnv(strings.TrimSpace(scanner.Text()))
292293

pkg/container/parse_env_file.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func parseEnvFile(e Container, srcPath string, env *map[string]string) common.Ex
2525
return err
2626
}
2727
s := bufio.NewScanner(reader)
28+
s.Buffer(nil, 1024*1024*1024) // increase buffer to 1GB to avoid scanner buffer overflow
2829
firstLine := true
2930
for s.Scan() {
3031
line := s.Text()
@@ -63,6 +64,6 @@ func parseEnvFile(e Container, srcPath string, env *map[string]string) common.Ex
6364
}
6465
}
6566
env = &localEnv
66-
return nil
67+
return s.Err()
6768
}
6869
}

pkg/runner/run_context.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ func (rc *RunContext) UpdateExtraPath(ctx context.Context, githubEnvPath string)
562562
return err
563563
}
564564
s := bufio.NewScanner(reader)
565+
s.Buffer(nil, 1024*1024*1024) // increase buffer to 1GB to avoid scanner buffer overflow
565566
firstLine := true
566567
for s.Scan() {
567568
line := s.Text()
@@ -576,7 +577,7 @@ func (rc *RunContext) UpdateExtraPath(ctx context.Context, githubEnvPath string)
576577
rc.addPath(ctx, line)
577578
}
578579
}
579-
return nil
580+
return s.Err()
580581
}
581582

582583
// stopJobContainer removes the job container (if it exists) and its volume (if it exists)

0 commit comments

Comments
 (0)