Skip to content

Commit

Permalink
Merge pull request #1 from connor-baer/fix-unique-comments
Browse files Browse the repository at this point in the history
Deduplicate pull request comments
  • Loading branch information
FredKSchott authored Aug 19, 2024
2 parents db9825f + 1ae6d89 commit 36c0b49
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ async function run(): Promise<void> {

// Otherwise, run verify and leave a PR comment
const verifyResult = await verify(github.context);
console.log('Verify:', verifyResult);
console.log("Verify:", verifyResult);
const formattedMessage = formatVerifyResult(verifyResult);
console.log('Verify Message:', verifyResult);
console.log("Verify Message:", verifyResult);

// TODO: different message for success vs. failure
const issue_number = payload.pull_request?.number;
Expand All @@ -32,7 +32,11 @@ async function run(): Promise<void> {
return;
}

const comment = { ...repo, issue_number, body: formattedMessage };
const comment = {
...repo,
issue_number,
body: `${UNIQUE_IDENTIFIER}\n\n${formattedMessage}`,
};
const comments = await octokit.rest.issues.listComments({
...repo,
issue_number,
Expand Down

0 comments on commit 36c0b49

Please sign in to comment.