Skip to content

Commit

Permalink
fix: skip duplicate comments
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jul 29, 2020
1 parent dd86bfd commit 82e3186
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,22 @@ Can you verify that the issue still exists after upgrading to the latest version
const comment = core.getInput('comment');

if (comment !== false) {
await client.issues.createComment({
const comments = await client.issues.listComments({
owner: issue.owner,
repo: issue.repo,
issue_number: issue.number,
body: messages.join('\n\n'),
});

const body = messages.join('\n\n');

if (!comments.data.some(comment => comment.body === body)) {
await client.issues.createComment({
owner: issue.owner,
repo: issue.repo,
issue_number: issue.number,
body,
});
}
}

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

0 comments on commit 82e3186

Please sign in to comment.