Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/detect_duplicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export async function fetchExistingIssues(
}

// Fallback: Check for bug or feature labels
const labelNames = issue.labels.map((l: any) =>
const labelNames = (issue.labels || []).map((l: any) =>
typeof l === "string" ? l.toLowerCase() : (l.name || "").toLowerCase()
);
return labelNames.includes("bug") || labelNames.includes("feature");
Expand All @@ -143,7 +143,7 @@ export async function fetchExistingIssues(
body: issue.body || "",
created_at: new Date(issue.created_at),
updated_at: new Date(issue.updated_at),
labels: issue.labels.map((l: any) =>
labels: (issue.labels || []).map((l: any) =>
typeof l === "string" ? l : l.name || ""
),
url: issue.html_url,
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/test-duplicate-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function previewDuplicateDetection() {
console.log("─".repeat(60));
console.log(`Title: ${issue.title}`);
console.log(`State: ${issue.state}`);
console.log(`Labels: ${issue.labels.map((l: any) => l.name).join(", ") || "none"}`);
console.log(`Labels: ${(issue.labels || []).map((l: any) => l.name).join(", ") || "none"}`);
console.log(`Type: ${issue.type || "NOT SET"}`);
console.log(`Created: ${issue.created_at}`);
console.log(`URL: ${issue.html_url}`);
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/test-github-api-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function testGitHubAPIResponse() {
console.log(` - number: ${firstIssue.number}`);
console.log(` - title: ${firstIssue.title}`);
console.log(` - state: ${firstIssue.state}`);
console.log(` - labels: ${firstIssue.labels.map((l: any) => l.name).join(", ")}`);
console.log(` - labels: ${(firstIssue.labels || []).map((l: any) => l.name).join(", ")}`);
console.log(` - type: ${firstIssue.type || "NOT AVAILABLE"}`);
console.log(` - pull_request: ${firstIssue.pull_request ? "YES" : "NO"}`);
console.log("");
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/test-real-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function testRealIssue() {
console.log("─".repeat(60));
console.log(`Title: ${issue.title}`);
console.log(`State: ${issue.state}`);
console.log(`Labels: ${issue.labels.map((l: any) => l.name).join(", ") || "none"}`);
console.log(`Labels: ${(issue.labels || []).map((l: any) => l.name).join(", ") || "none"}`);
console.log(`Created: ${issue.created_at}`);
console.log(`URL: ${issue.html_url}`);
console.log("─".repeat(60));
Expand Down