claude-task-worker 0.136.0 → 0.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NWYH24MB.js → chunk-R4T3CDMO.js} +7 -4
- package/dist/gh.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/lib.js +1 -1
- package/package.json +1 -1
|
@@ -361,8 +361,11 @@ async function fetchPRChecks(prNumber) {
|
|
|
361
361
|
if (!output) return [];
|
|
362
362
|
return JSON.parse(output);
|
|
363
363
|
}
|
|
364
|
+
function excludePrsByLabels(prs, excludeLabels) {
|
|
365
|
+
return prs.filter((pr) => !pr.labels.some((l) => excludeLabels.includes(l.name)));
|
|
366
|
+
}
|
|
367
|
+
var PR_LIST_FETCH_LIMIT = 50;
|
|
364
368
|
async function listPullRequestsWithChecks(assignee, label, excludeLabels = [], limit = 5) {
|
|
365
|
-
const search = ["sort:created-asc", ...excludeLabels.map((l) => `-label:"${l}"`)].join(" ");
|
|
366
369
|
const args = [
|
|
367
370
|
"pr",
|
|
368
371
|
"list",
|
|
@@ -371,9 +374,9 @@ async function listPullRequestsWithChecks(assignee, label, excludeLabels = [], l
|
|
|
371
374
|
"--json",
|
|
372
375
|
"number,title,labels,headRefName",
|
|
373
376
|
"--search",
|
|
374
|
-
|
|
377
|
+
"sort:created-asc",
|
|
375
378
|
"--limit",
|
|
376
|
-
String(
|
|
379
|
+
String(PR_LIST_FETCH_LIMIT)
|
|
377
380
|
];
|
|
378
381
|
if (assignee) {
|
|
379
382
|
args.push("--assignee", assignee);
|
|
@@ -382,7 +385,7 @@ async function listPullRequestsWithChecks(assignee, label, excludeLabels = [], l
|
|
|
382
385
|
args.push("--label", label);
|
|
383
386
|
}
|
|
384
387
|
const output = await execGh(args);
|
|
385
|
-
const prs = JSON.parse(output);
|
|
388
|
+
const prs = excludePrsByLabels(JSON.parse(output), excludeLabels).slice(0, limit);
|
|
386
389
|
const withChecks = await Promise.all(prs.map(async (pr) => ({ ...pr, checks: await fetchPRChecks(pr.number) })));
|
|
387
390
|
return withChecks.filter((pr) => isCICompleted(pr.checks));
|
|
388
391
|
}
|
package/dist/gh.d.ts
CHANGED
|
@@ -85,6 +85,11 @@ export interface PullRequestWithChecks extends PullRequest {
|
|
|
85
85
|
checks: PRCheck[];
|
|
86
86
|
}
|
|
87
87
|
export declare function isCICompleted(checks: PRCheck[]): boolean;
|
|
88
|
+
export declare function excludePrsByLabels<T extends {
|
|
89
|
+
labels: {
|
|
90
|
+
name: string;
|
|
91
|
+
}[];
|
|
92
|
+
}>(prs: T[], excludeLabels: string[]): T[];
|
|
88
93
|
export declare function listPullRequestsWithChecks(assignee?: string, label?: string, excludeLabels?: string[], limit?: number): Promise<PullRequestWithChecks[]>;
|
|
89
94
|
export declare function addLabel(type: "issue" | "pr", number: number, label: string): Promise<void>;
|
|
90
95
|
export declare function addAssignee(type: "issue" | "pr", number: number, login: string): Promise<void>;
|
package/dist/index.js
CHANGED
package/dist/lib.js
CHANGED