MCPcopy Index your code
hub / github.com/kirodotdev/Kiro / postDuplicateComment

Function postDuplicateComment

scripts/detect_duplicates.ts:476–511  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  issueNumber: number,
  duplicates: DuplicateMatch[],
  githubToken: string
)

Source from the content-addressed store, hash-verified

474 * Post duplicate comment to issue
475 */
476export async function postDuplicateComment(
477 owner: string,
478 repo: string,
479 issueNumber: number,
480 duplicates: DuplicateMatch[],
481 githubToken: string
482): Promise<boolean> {
483 if (duplicates.length === 0) {
484 return false;
485 }
486
487 try {
488 const client = new Octokit({ auth: githubToken });
489 const comment = generateDuplicateComment(duplicates);
490
491 console.log(`Posting duplicate comment to issue #${issueNumber}`);
492
493 await retryWithBackoff(async () => {
494 await client.issues.createComment({
495 owner,
496 repo,
497 issue_number: issueNumber,
498 body: comment,
499 });
500 });
501
502 console.log(`Successfully posted duplicate comment to issue #${issueNumber}`);
503 return true;
504 } catch (error) {
505 console.error(
506 `Error posting duplicate comment to issue #${issueNumber}:`,
507 error
508 );
509 return false;
510 }
511}

Callers 1

mainFunction · 0.85

Calls 2

generateDuplicateCommentFunction · 0.85
retryWithBackoffFunction · 0.85

Tested by

no test coverage detected