Compare commits

...

2 Commits

Author SHA1 Message Date
Eli Reisman 455d760c6a regen dist 2024-07-04 00:06:17 +00:00
Eli Reisman 46a56b892b short-term fix: hard truncate core.summary if it is over 1024k size limit 2024-07-04 00:05:52 +00:00
4 changed files with 17 additions and 4 deletions
Generated Vendored
+8 -2
View File
@@ -676,8 +676,13 @@ function run() {
core.setOutput('dependency-changes', JSON.stringify(changes));
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
if (rendered.length >= comment_pr_1.MAX_COMMENT_LENGTH) {
@@ -1324,7 +1329,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.addDeniedToSummary = exports.addSnapshotWarnings = exports.addScorecardToSummary = exports.addScannedDependencies = exports.addLicensesToSummary = exports.addChangeVulnerabilitiesToSummary = exports.addSummaryToSummary = void 0;
exports.addDeniedToSummary = exports.addSnapshotWarnings = exports.addScorecardToSummary = exports.addScannedDependencies = exports.addLicensesToSummary = exports.addChangeVulnerabilitiesToSummary = exports.addSummaryToSummary = exports.MAX_SUMMARY_LENGTH = void 0;
const core = __importStar(__nccwpck_require__(2186));
const utils_1 = __nccwpck_require__(918);
const icons = {
@@ -1332,6 +1337,7 @@ const icons = {
cross: '❌',
warning: '⚠️'
};
exports.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
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+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