Skip to content

Commit f8dc4cf

Browse files
authored
Check buffer length (JamesIves#668)
* Check buffer len * Update execute.ts * Format
1 parent 7e40b83 commit f8dc4cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/execute.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {exec} from '@actions/exec'
2+
import buffer from 'buffer'
23

3-
let output: string
4+
let output = ''
45

56
/** Wrapper around the GitHub toolkit exec command which returns the output.
67
* Also allows you to easily toggle the current working directory.
@@ -29,5 +30,7 @@ export async function execute(
2930
}
3031

3132
export function stdout(data: any): string | void {
32-
output += data.toString().trim()
33+
if (output.length < buffer.constants.MAX_STRING_LENGTH) {
34+
output += data.toString().trim()
35+
}
3336
}

0 commit comments

Comments
 (0)