Skip to content

Commit

Permalink
fix: knip
Browse files Browse the repository at this point in the history
:
  • Loading branch information
sshivaditya committed Sep 13, 2024
1 parent 736a0bf commit fe17b3e
Showing 3 changed files with 11 additions and 18 deletions.
10 changes: 0 additions & 10 deletions src/adapters/supabase/helpers/issues.ts
Original file line number Diff line number Diff line change
@@ -3,16 +3,6 @@ import { SuperSupabase } from "./supabase";
import { Context } from "../../../types/context";
import { markdownToPlainText } from "../../utils/markdown-to-plaintext";

export interface IssueType {
id: string;
markdown?: string;
author_id: number;
created_at: string;
modified_at: string;
payloadObject: Record<string, unknown> | null;
embedding: number[];
}

export interface IssueSimilaritySearchResult {
issue_id: string;
issue_plaintext: string;
16 changes: 9 additions & 7 deletions src/handlers/issue-deduplication.ts
Original file line number Diff line number Diff line change
@@ -72,13 +72,15 @@ export async function issueChecker(context: Context): Promise<boolean> {
issue_number: issue.number,
state: "open",
});
//Remove the "unplanned" label
await context.octokit.issues.removeLabel({
owner: payload.repository.owner.login,
repo: payload.repository.name,
issue_number: issue.number,
name: "unplanned",
});
//Remove the "unplanned" label if it exists
if (issue.labels && issue.labels.find((label) => label.name === "unplanned")) {
await context.octokit.issues.removeLabel({
owner: payload.repository.owner.login,
repo: payload.repository.name,
issue_number: issue.number,
name: "unplanned",
});
}
// Check if there is already a comment on the issue
const existingComment = await context.octokit.issues.listComments({
owner: payload.repository.owner.login,
3 changes: 2 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@ export async function runPlugin(context: Context) {
} else if (isIssueEvent(context)) {
switch (eventName) {
case "issues.opened":
return (await issueChecker(context)) ? null : await addIssue(context);
await issueChecker(context);
return await addIssue(context);
case "issues.edited":
await issueChecker(context);
return await updateIssue(context);

0 comments on commit fe17b3e

Please sign in to comment.