Parse branch patch targets

Heartwood's `MergeTarget` gained a `Branch` variant, so `target` can be
an object now. One such patch failed the parse for the whole patch list.
This commit is contained in:
Rūdolfs Ošiņš
2026-09-02 08:38:07 +02:00
parent 60fd9a1288
commit 1a160e55c1
2 changed files with 10 additions and 1 deletions
+2
View File
@@ -35,6 +35,7 @@ import type { Issue, IssueState } from "./lib/repo/issue.js";
import type {
LifecycleState,
Merge,
MergeTarget,
Patch,
PatchState,
Review,
@@ -88,6 +89,7 @@ export type {
LifecycleState,
Location,
Merge,
MergeTarget,
Patch,
PatchState,
PeerRefs,
+8 -1
View File
@@ -34,6 +34,13 @@ const patchStateSchema = union([
}),
]);
export type MergeTarget = z.infer<typeof mergeTargetSchema>;
const mergeTargetSchema = union([
literal("delegates"),
object({ branch: string() }),
]);
export type Merge = z.infer<typeof mergeSchema>;
const mergeSchema = object({
@@ -89,7 +96,7 @@ export const patchSchema = object({
author: authorSchema,
title: string(),
state: patchStateSchema,
target: string(),
target: mergeTargetSchema,
labels: array(string()),
merges: array(mergeSchema),
assignees: array(authorSchema),