From f8dc4cf21d029801ee1d3aea300a3c3beb64d45b Mon Sep 17 00:00:00 2001 From: James Ives Date: Wed, 21 Apr 2021 11:03:15 -0400 Subject: [PATCH] Check buffer length (#668) * Check buffer len * Update execute.ts * Format --- src/execute.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/execute.ts b/src/execute.ts index 02caa011..92da0437 100644 --- a/src/execute.ts +++ b/src/execute.ts @@ -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 { - output += data.toString().trim() + if (output.length < buffer.constants.MAX_STRING_LENGTH) { + output += data.toString().trim() + } }