short-term fix: hard truncate core.summary if it is over 1024k size limit

This commit is contained in:
Eli Reisman
2024-07-04 00:05:52 +00:00
parent df5d74f5d3
commit 46a56b892b
2 changed files with 8 additions and 1 deletions
+6 -1
View File
@@ -169,8 +169,13 @@ async function run(): Promise<void> {
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
+2
View File
@@ -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