Merge pull request #77 from zereight/fix/issue_labels

FIX: get issues labels
This commit is contained in:
bbang-dduck
2025-06-02 21:35:37 +09:00
committed by GitHub
2 changed files with 6 additions and 4 deletions

View File

@ -903,11 +903,13 @@ async function listIssues(
// Add all query parameters
Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) {
if (key === "label_name" && Array.isArray(value)) {
if (key === "labels" && Array.isArray(value)) {
// Handle array of labels
url.searchParams.append(key, value.join(","));
value.forEach(label => {
url.searchParams.append("labels[]", label.toString());
});
} else {
url.searchParams.append(key, value.toString());
url.searchParams.append("labels[]", value.toString());
}
}
});

View File

@ -890,7 +890,7 @@ export const ListIssuesSchema = z.object({
created_after: z.string().optional().describe("Return issues created after the given time"),
created_before: z.string().optional().describe("Return issues created before the given time"),
due_date: z.string().optional().describe("Return issues that have the due date"),
label_name: z.array(z.string()).optional().describe("Array of label names"),
labels: z.array(z.string()).optional().describe("Array of label names"),
milestone: z.string().optional().describe("Milestone title"),
scope: z
.enum(["created-by-me", "assigned-to-me", "all"])