Skip to content

Commit 3ee2a09

Browse files
committed
fix issues with duplicate issues
1 parent b7972fb commit 3ee2a09

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/index.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async function getExistingDiscussions(octokit: Octokit, login: string) {
120120
}
121121
`,
122122
{
123-
q: `author:${login}`,
123+
q: `author:${login} -repo:the-guild-org/crisp-chats`,
124124
}
125125
);
126126

@@ -158,7 +158,7 @@ async function getExistingIssues(octokit: Octokit, login: string) {
158158
}
159159
`,
160160
{
161-
q: `author:${login}`,
161+
q: `author:${login} -repo:the-guild-org/crisp-chats`,
162162
}
163163
);
164164

@@ -167,19 +167,6 @@ async function getExistingIssues(octokit: Octokit, login: string) {
167167

168168
type Page = Awaited<ReturnType<Client["search"]>>["results"][number];
169169

170-
async function shouldDeletePage(mdBlocks: MdBlock[]) {
171-
if (
172-
mdBlocks.length > 0 &&
173-
mdBlocks[0].parent &&
174-
typeof mdBlocks[0].parent === "string" &&
175-
mdBlocks[0].parent.trim().startsWith("/github-public")
176-
) {
177-
return false;
178-
}
179-
180-
return true;
181-
}
182-
183170
type IssueCreateRecord = {
184171
page: Page;
185172
repoId: string;
@@ -304,12 +291,11 @@ async function buildUpdatePlan(
304291
delete: [],
305292
};
306293

307-
const modified = await Promise.all(
294+
await Promise.all(
308295
pages.map(async (page) => {
309296
const pageTitle = extractPageTitle(page);
310297

311298
if (!pageTitle) {
312-
console.warn(`Skipped page due to missing title info:`, page);
313299
return;
314300
}
315301

@@ -619,6 +605,7 @@ async function run(env: Env) {
619605
getExistingDiscussions(octokit, login),
620606
getExistingIssues(octokit, login),
621607
]);
608+
console.log("existing issues found:", issues);
622609
const { discussions: discussionsPlan, issues: issuesPlan } =
623610
await buildUpdatePlan(octokit, n2m, relevantPages, discussions, issues);
624611

0 commit comments

Comments
 (0)