Skip to content

Commit 8916fb7

Browse files
committed
chore: lint issueBot
1 parent 8a3c4bd commit 8916fb7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/issueBot.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {execSync} from "node:child_process";
33
async function checkDuplicateIssue(github, context, name) {
44
// Search for existing issues with the same `name`
55
const searchQuery = `repo:${context.repo.owner}/${context.repo.repo} is:issue -is:pr "${name}" label:"new device support","external converter"`;
6-
6+
77
try {
88
const searchResults = await github.rest.search.issuesAndPullRequests({q: searchQuery, per_page: 100});
9-
9+
1010
// Filter out the current issue and return the first duplicate found
1111
const existingIssues = searchResults.data.items.filter((item) => item.number !== context.payload.issue.number).map((i) => `#${i.number}`);
1212
if (existingIssues.length > 0) {
@@ -18,20 +18,20 @@ async function checkDuplicateIssue(github, context, name) {
1818
1919
This issue will be closed. Please follow the existing issue for updates.`,
2020
});
21-
21+
2222
await github.rest.issues.update({
2323
owner: context.repo.owner,
2424
repo: context.repo.repo,
2525
issue_number: context.payload.issue.number,
2626
state: "closed",
2727
});
28-
28+
2929
return true;
3030
}
3131
} catch (error) {
3232
console.error(`Error searching for duplicate issues with ${name}:`, error);
3333
}
34-
34+
3535
return false;
3636
}
3737

0 commit comments

Comments
 (0)