diff --git a/dist/index.js b/dist/index.js index 0f2d3a2..a8c87fc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -19269,7 +19269,7 @@ function run() { if (applicableChecklistPaths.length > 0) { const body = [ `${header}\n\n`, - ...applicableChecklistPaths.map(([path, items]) => formatItemsForPath(existingComment.body, [path, items])), + ...applicableChecklistPaths.map(([path, items]) => formatItemsForPath(!!existingComment ? existingComment.body : undefined, [path, items])), `\n${footer}`, ].join(""); if (existingComment) { diff --git a/index.ts b/index.ts index 78df1e8..4b881ed 100644 --- a/index.ts +++ b/index.ts @@ -103,7 +103,10 @@ async function run() { const body = [ `${header}\n\n`, ...applicableChecklistPaths.map(([path, items]) => - formatItemsForPath(existingComment.body, [path, items]) + formatItemsForPath( + !!existingComment ? existingComment.body : undefined, + [path, items] + ) ), `\n${footer}`, ].join("");