Skip to content

Commit 8e51299

Browse files
authored
Merge pull request #1007 from gitulisca/gitulisca/summary-size-limit
Make handleLargeSummary also update core.summary
2 parents 07b9157 + 7a99011 commit 8e51299

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

dist/index.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,17 @@ export async function handleLargeSummary(
8686
retentionDays: 1
8787
})
8888

89-
// Return a minimal summary with a link to the artifact
90-
return `# Dependency Review Summary
89+
// Return a shorter summary with a link to the artifact
90+
const shortSummary = `# Dependency Review Summary
9191
9292
The full dependency review summary is too large to display here. Please download the artifact named "${artifactName}" to view the complete report.
9393
9494
[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`
95+
96+
// Set core.summary to the shorter summary value to avoid exceeding MAX_SUMMARY_SIZE
97+
core.summary.emptyBuffer()
98+
core.summary.addRaw(shortSummary)
99+
return shortSummary
95100
} catch (error) {
96101
core.warning(
97102
`Failed to handle large summary: ${error instanceof Error ? error.message : 'Unknown error'}`

0 commit comments

Comments
 (0)