From 199dbebb704ac6e1d88e3a90e31300d3b1dfa941 Mon Sep 17 00:00:00 2001 From: Sergey Sova Date: Thu, 6 Oct 2022 18:54:12 +0400 Subject: [PATCH] Do not print empty tables --- dist/index.js | 6 ++++-- src/main.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1fad6ab..b7a0441 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14918,8 +14918,10 @@ function main() { const commentBody = [ SIZE_COMPARE_HEADING, createCompareLink(owner, repo, latestRecord, currentHistoryRecord), - changesToMarkdownTable(significantChanges), - createCollapsibleMarkdown(`Files wasn't changed`, changesToMarkdownTable(foldedChanges)), + significantChanges.length > 0 ? changesToMarkdownTable(significantChanges) : '', + foldedChanges.length > 0 + ? createCollapsibleMarkdown(`Files wasn't changed`, changesToMarkdownTable(foldedChanges)) + : '', ].join('\r\n'); const previousComment = yield previousCommentPromise; if (previousComment) { diff --git a/src/main.ts b/src/main.ts index f906bd6..b1e10a4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -160,8 +160,10 @@ async function main() { const commentBody = [ SIZE_COMPARE_HEADING, createCompareLink(owner, repo, latestRecord, currentHistoryRecord), - changesToMarkdownTable(significantChanges), - createCollapsibleMarkdown(`Files wasn't changed`, changesToMarkdownTable(foldedChanges)), + significantChanges.length > 0 ? changesToMarkdownTable(significantChanges) : '', + foldedChanges.length > 0 + ? createCollapsibleMarkdown(`Files wasn't changed`, changesToMarkdownTable(foldedChanges)) + : '', ].join('\r\n'); const previousComment = await previousCommentPromise;