Skip to content

Commit

Permalink
Merge pull request #28 from CryogenicBot/preserve-checklist-state
Browse files Browse the repository at this point in the history
Adding Null Check for Existing Comment
  • Loading branch information
wyozi authored Aug 21, 2023
2 parents e57fd65 + 705a53a commit 5993c39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("");
Expand Down

0 comments on commit 5993c39

Please sign in to comment.