Skip to content

Commit

Permalink
feat: Allow setting the final status and summary on the run without t…
Browse files Browse the repository at this point in the history
…he is_final flag. Removed is_final to give users more control over the run's lifecycle
  • Loading branch information
uleMeshcloud committed Nov 18, 2024
1 parent 0add033 commit 0d72419
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 2 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -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)}`);

Expand Down

0 comments on commit 0d72419

Please sign in to comment.