Add min-comment to fix max-comment length issue

This commit is contained in:
Justin Hutchings
2024-05-06 00:26:50 +00:00
committed by Eli Reisman
parent 8d625cd32e
commit 48fae2e703
5 changed files with 138 additions and 8 deletions

View File

@@ -12,14 +12,20 @@ const octo = new retryingOctokit(
// Comment Marker to identify an existing comment to update, so we don't spam the PR with comments
const COMMENT_MARKER = '<!-- dependency-review-pr-comment-marker -->'
const MAX_COMMENT_LENGTH = 65536
export async function commentPr(
summary: typeof core.summary,
config: ConfigurationOptions
config: ConfigurationOptions,
minComment: string
): Promise<void> {
const commentContent = summary.stringify()
core.setOutput('comment-content', commentContent)
if (commentContent.length >= MAX_COMMENT_LENGTH) {
core.setOutput('comment-content', minComment)
} else {
core.setOutput('comment-content', commentContent)
}
if (
!(