From b9980d6db77b429efa66b950aef387eea018775d Mon Sep 17 00:00:00 2001 From: hubert <60143306+hraytilakhealthcare@users.noreply.github.com> Date: Fri, 16 Dec 2022 20:44:40 +0100 Subject: [PATCH] Trims output length to avoid hitting github 2Mb limitation (#206) Co-authored-by: ahub --- src/model/results-check.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/model/results-check.ts b/src/model/results-check.ts index 50b48b0..541c9d8 100644 --- a/src/model/results-check.ts +++ b/src/model/results-check.ts @@ -76,6 +76,14 @@ const ResultsCheck = { const pullRequest = github.context.payload.pull_request; const headSha = (pullRequest && pullRequest.head.sha) || github.context.sha; + const maxLen = 65534; + if(output.length > maxLen) + { + core.warning(`Output too long (${output.length}) truncating to ${maxLen}`); + output = output.substring(0, maxLen); + } + + core.info(`Posting results for ${headSha}`); const createCheckRequest = { ...github.context.repo,