diff --git a/src/main.ts b/src/main.ts index 0be8abb..5bea59e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -169,8 +169,13 @@ async function run(): Promise { summary.addScannedDependencies(changes) printScannedDependencies(changes) - // include full summary in output; Actions will truncate if oversized + // core.summary output must also be kept below 1024k let rendered = core.summary.stringify() + if (rendered.length >= summary.MAX_SUMMARY_LENGTH) { + rendered = rendered.substring(0, summary.MAX_SUMMARY_LENGTH) + core.summary.clear() + core.summary.addRaw(rendered) + } core.setOutput('comment-content', rendered) // if the summary is oversized, replace with minimal version diff --git a/src/summary.ts b/src/summary.ts index dc22ee2..d558dde 100644 --- a/src/summary.ts +++ b/src/summary.ts @@ -10,6 +10,8 @@ const icons = { warning: '⚠️' } +export const MAX_SUMMARY_LENGTH = 1048576 + // generates the DR report summmary and caches it to the Action's core.summary. // returns the DR summary string, ready to be posted as a PR comment if the // final DR report is too large