Skip to content

Commit

Permalink
Always replace the body of the comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-imx committed Nov 13, 2023
1 parent 65aa50c commit 82bdf50
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions .github/utils/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@ const updateComment = (id, report) => {
exports.updateComment = async (target, report) => {
const comment = await getExistingReportComment();
if (comment) {
const targetRegex = new RegExp(`(\\<details><summary><strong>${target}:)([\\s\\S]+?)(table\\>\\n<\\/details\\>)`);
let newComment;
if (targetRegex.test(comment.body)) {
newComment = comment.body.replace(targetRegex, report);
} else {
newComment = comment.body + report;
}
await updateComment(comment.id, newComment);
await updateComment(comment.id, REPORT_TITLE + report);
} else {
await createComment(REPORT_TITLE + report);
}
Expand Down

0 comments on commit 82bdf50

Please sign in to comment.