Skip to content

Commit 82e3186

Browse files
committed
fix: skip duplicate comments
1 parent dd86bfd commit 82e3186

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,22 @@ Can you verify that the issue still exists after upgrading to the latest version
5252
const comment = core.getInput('comment');
5353

5454
if (comment !== false) {
55-
await client.issues.createComment({
55+
const comments = await client.issues.listComments({
5656
owner: issue.owner,
5757
repo: issue.repo,
5858
issue_number: issue.number,
59-
body: messages.join('\n\n'),
6059
});
60+
61+
const body = messages.join('\n\n');
62+
63+
if (!comments.data.some(comment => comment.body === body)) {
64+
await client.issues.createComment({
65+
owner: issue.owner,
66+
repo: issue.repo,
67+
issue_number: issue.number,
68+
body,
69+
});
70+
}
6171
}
6272

6373
const missingVersionsLabel = core.getInput('missing-versions-label');

0 commit comments

Comments
 (0)