From 0d72419e09ce27678f2fd7f40428c06a9f32aaa4 Mon Sep 17 00:00:00 2001 From: Le Date: Mon, 18 Nov 2024 11:42:53 +0100 Subject: [PATCH] feat: Allow setting the final status and summary on the run without the is_final flag. Removed is_final to give users more control over the run's lifecycle --- action.yml | 5 ++--- src/index.ts | 11 ++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index 4e8bf52..45ef2d9 100644 --- a/action.yml +++ b/action.yml @@ -13,10 +13,9 @@ inputs: system_message: description: 'The system message for a failed step' required: false - is_final: - description: 'Indicates if this is the final status report' + final_status: + description: 'The final status is the run's end-state, combining all step outcomes into one status result based on your logic.' required: false - default: 'false' summary: description: 'The summary message for the final status report' required: false diff --git a/src/index.ts b/src/index.ts index 79b5c48..b804001 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,8 +13,8 @@ async function run() { const status = core.getInput('status'); const userMessage = core.getInput('user_message'); const systemMessage = core.getInput('system_message'); - const isFinal = core.getInput('is_final') === 'true'; const summary = core.getInput('summary'); + const finalStatus = core.getInput('final_status'); const tempDir = process.env.RUNNER_TEMP || os.tmpdir(); core.debug(`Temporary directory: ${tempDir}`); @@ -49,19 +49,16 @@ async function run() { } const data: any = { - status: isFinal ? status : "IN_PROGRESS", + status: finalStatus ? finalStatus : "IN_PROGRESS", steps: [{ id: stepId, status: status, userMessage: userMessage, systemMessage: systemMessage - }] + }], + summary: summary }; - if (isFinal) { - data.summary = summary; - } - core.debug(`Constructed data object: ${JSON.stringify(data)}`); console.log(`Constructed data object: ${JSON.stringify(data)}`);