short-term fix: hard truncate core.summary if it is over 1024k size limit
This commit is contained in:
+6
-1
@@ -169,8 +169,13 @@ async function run(): Promise<void> {
|
|||||||
summary.addScannedDependencies(changes)
|
summary.addScannedDependencies(changes)
|
||||||
printScannedDependencies(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()
|
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)
|
core.setOutput('comment-content', rendered)
|
||||||
|
|
||||||
// if the summary is oversized, replace with minimal version
|
// if the summary is oversized, replace with minimal version
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const icons = {
|
|||||||
warning: '⚠️'
|
warning: '⚠️'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const MAX_SUMMARY_LENGTH = 1048576
|
||||||
|
|
||||||
// generates the DR report summmary and caches it to the Action's core.summary.
|
// 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
|
// returns the DR summary string, ready to be posted as a PR comment if the
|
||||||
// final DR report is too large
|
// final DR report is too large
|
||||||
|
|||||||
Reference in New Issue
Block a user