Skip to content

Commit

Permalink
Merge pull request #39 from sshivaditya2019/issuesim
Browse files Browse the repository at this point in the history
fix: line break issue
  • Loading branch information
0x4007 authored Oct 18, 2024
2 parents 9cbe059 + abf483c commit 523b437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handlers/issue-deduplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export async function issueChecker(context: Context): Promise<boolean> {
}
issueBody = removeFootnotes(issueBody);
const similarIssues = await supabase.issue.findSimilarIssues(issue.title + removeFootnotes(issueBody), context.config.warningThreshold, issue.node_id);

if (similarIssues && similarIssues.length > 0) {
const matchIssues = similarIssues.filter((issue) => issue.similarity >= context.config.matchThreshold);
if (matchIssues.length > 0) {
Expand All @@ -53,7 +54,6 @@ export async function issueChecker(context: Context): Promise<boolean> {
});
return true;
}

if (similarIssues.length > 0) {
logger.info(`Similar issue which matches more than ${context.config.warningThreshold} already exists`);
await handleSimilarIssuesComment(context, payload, issueBody, issue.number, similarIssues);
Expand Down Expand Up @@ -259,5 +259,5 @@ export function removeFootnotes(content: string): string {
contentWithoutFootnotes = contentWithoutFootnotes.replace(new RegExp(`\\[\\^${footnoteNumber}\\^\\]`, "g"), "");
});
}
return contentWithoutFootnotes.replace(/\n{2,}/g, "\n").trim();
return contentWithoutFootnotes;
}

0 comments on commit 523b437

Please sign in to comment.