Merge pull request #1007 from gitulisca/gitulisca/summary-size-limit
Make handleLargeSummary also update core.summary
This commit is contained in:
+6
-2
@@ -717,12 +717,16 @@ function handleLargeSummary(summaryContent) {
|
|||||||
yield artifactClient.uploadArtifact(artifactName, files, '.', {
|
yield artifactClient.uploadArtifact(artifactName, files, '.', {
|
||||||
retentionDays: 1
|
retentionDays: 1
|
||||||
});
|
});
|
||||||
// Return a minimal summary with a link to the artifact
|
// Return a shorter summary with a link to the artifact
|
||||||
return `# Dependency Review Summary
|
const shortSummary = `# Dependency Review Summary
|
||||||
|
|
||||||
The full dependency review summary is too large to display here. Please download the artifact named "${artifactName}" to view the complete report.
|
The full dependency review summary is too large to display here. Please download the artifact named "${artifactName}" to view the complete report.
|
||||||
|
|
||||||
[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`;
|
[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`;
|
||||||
|
// Set core.summary to the shorter summary value to avoid exceeding MAX_SUMMARY_SIZE
|
||||||
|
core.summary.emptyBuffer();
|
||||||
|
core.summary.addRaw(shortSummary);
|
||||||
|
return shortSummary;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.warning(`Failed to handle large summary: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
core.warning(`Failed to handle large summary: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+7
-2
@@ -86,12 +86,17 @@ export async function handleLargeSummary(
|
|||||||
retentionDays: 1
|
retentionDays: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
// Return a minimal summary with a link to the artifact
|
// Return a shorter summary with a link to the artifact
|
||||||
return `# Dependency Review Summary
|
const shortSummary = `# Dependency Review Summary
|
||||||
|
|
||||||
The full dependency review summary is too large to display here. Please download the artifact named "${artifactName}" to view the complete report.
|
The full dependency review summary is too large to display here. Please download the artifact named "${artifactName}" to view the complete report.
|
||||||
|
|
||||||
[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`
|
[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`
|
||||||
|
|
||||||
|
// Set core.summary to the shorter summary value to avoid exceeding MAX_SUMMARY_SIZE
|
||||||
|
core.summary.emptyBuffer()
|
||||||
|
core.summary.addRaw(shortSummary)
|
||||||
|
return shortSummary
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.warning(
|
core.warning(
|
||||||
`Failed to handle large summary: ${error instanceof Error ? error.message : 'Unknown error'}`
|
`Failed to handle large summary: ${error instanceof Error ? error.message : 'Unknown error'}`
|
||||||
|
|||||||
Reference in New Issue
Block a user