Update job summary with progress comment content
Modified reportProgress() to write the same content to core.summary with overwrite: true. This replaces the verbose log accumulation with the concise progress updates that stakeholders see in comments. The job summary now stays in sync with the progress comment, providing a clean overview of the agent's work rather than accumulated logs throughout execution. Fixes #17
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import * as core from "@actions/core";
|
||||||
import { type } from "arktype";
|
import { type } from "arktype";
|
||||||
import type { Payload } from "../external.ts";
|
import type { Payload } from "../external.ts";
|
||||||
import { agentsManifest } from "../external.ts";
|
import { agentsManifest } from "../external.ts";
|
||||||
@@ -234,6 +235,11 @@ export async function reportProgress(
|
|||||||
|
|
||||||
progressCommentWasUpdated = true;
|
progressCommentWasUpdated = true;
|
||||||
|
|
||||||
|
// update job summary with the same content as the progress comment
|
||||||
|
if (process.env.GITHUB_ACTIONS) {
|
||||||
|
await core.summary.addRaw(bodyWithFooter).write({ overwrite: true });
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
commentId: result.data.id,
|
commentId: result.data.id,
|
||||||
url: result.data.html_url,
|
url: result.data.html_url,
|
||||||
@@ -281,6 +287,11 @@ export async function reportProgress(
|
|||||||
body: bodyWithPlanLink,
|
body: bodyWithPlanLink,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// update job summary with the same content as the progress comment
|
||||||
|
if (process.env.GITHUB_ACTIONS) {
|
||||||
|
await core.summary.addRaw(bodyWithPlanLink).write({ overwrite: true });
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
commentId: updateResult.data.id,
|
commentId: updateResult.data.id,
|
||||||
url: updateResult.data.html_url,
|
url: updateResult.data.html_url,
|
||||||
@@ -289,6 +300,11 @@ export async function reportProgress(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update job summary with the same content as the progress comment
|
||||||
|
if (process.env.GITHUB_ACTIONS) {
|
||||||
|
await core.summary.addRaw(initialBody).write({ overwrite: true });
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
commentId: result.data.id,
|
commentId: result.data.id,
|
||||||
url: result.data.html_url,
|
url: result.data.html_url,
|
||||||
|
|||||||
Reference in New Issue
Block a user