Check buffer length (#668)

* Check buffer len

* Update execute.ts

* Format
This commit is contained in:
James Ives 2021-04-21 11:03:15 -04:00 committed by GitHub
parent 7e40b83dc2
commit f8dc4cf21d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import {exec} from '@actions/exec'
import buffer from 'buffer'
let output: string
let output = ''
/** Wrapper around the GitHub toolkit exec command which returns the output.
* Also allows you to easily toggle the current working directory.
@ -29,5 +30,7 @@ export async function execute(
}
export function stdout(data: any): string | void {
if (output.length < buffer.constants.MAX_STRING_LENGTH) {
output += data.toString().trim()
}
}