diff --git a/entry b/entry index ff83e30..76093f4 100755 --- a/entry +++ b/entry @@ -140237,7 +140237,7 @@ function buildRuntimeContext(ctx) { return encode(filtered); } function buildEventData(event) { - const { title, body, ...rest } = event; + const { title, body, trigger, ...rest } = event; const sections = []; const trimmedTitle = typeof title === "string" ? title.trim() : ""; const trimmedBody = typeof body === "string" ? body.trim() : ""; @@ -140247,9 +140247,10 @@ function buildEventData(event) { if (trimmedBody) { sections.push(trimmedBody); } - if (Object.keys(rest).length > 0) { + const restWithTrigger = trigger === "workflow_dispatch" ? rest : { trigger, ...rest }; + if (Object.keys(restWithTrigger).length > 0) { if (sections.length > 0) sections.push("---"); - sections.push(encode(rest)); + sections.push(encode(restWithTrigger)); } return sections.join("\n\n"); } diff --git a/utils/instructions.ts b/utils/instructions.ts index a0b2812..c69e593 100644 --- a/utils/instructions.ts +++ b/utils/instructions.ts @@ -51,7 +51,7 @@ function buildRuntimeContext(ctx: InstructionsContext): string { } function buildEventData(event: PayloadEvent): string { - const { title, body, ...rest } = event; + const { title, body, trigger, ...rest } = event; const sections: string[] = []; // render title + body as markdown @@ -66,10 +66,13 @@ function buildEventData(event: PayloadEvent): string { sections.push(trimmedBody); } + // include trigger in rest unless it's workflow_dispatch (not informative) + const restWithTrigger = trigger === "workflow_dispatch" ? rest : { trigger, ...rest }; + // separator and toon-encoded remaining fields - if (Object.keys(rest).length > 0) { + if (Object.keys(restWithTrigger).length > 0) { if (sections.length > 0) sections.push("---"); - sections.push(toonEncode(rest)); + sections.push(toonEncode(restWithTrigger)); } return sections.join("\n\n");