Skip to content

Commit 0d72419

Browse files
committed
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
1 parent 0add033 commit 0d72419

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

action.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ inputs:
1313
system_message:
1414
description: 'The system message for a failed step'
1515
required: false
16-
is_final:
17-
description: 'Indicates if this is the final status report'
16+
final_status:
17+
description: 'The final status is the run's end-state, combining all step outcomes into one status result based on your logic.'
1818
required: false
19-
default: 'false'
2019
summary:
2120
description: 'The summary message for the final status report'
2221
required: false

src/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ async function run() {
1313
const status = core.getInput('status');
1414
const userMessage = core.getInput('user_message');
1515
const systemMessage = core.getInput('system_message');
16-
const isFinal = core.getInput('is_final') === 'true';
1716
const summary = core.getInput('summary');
17+
const finalStatus = core.getInput('final_status');
1818

1919
const tempDir = process.env.RUNNER_TEMP || os.tmpdir();
2020
core.debug(`Temporary directory: ${tempDir}`);
@@ -49,19 +49,16 @@ async function run() {
4949
}
5050

5151
const data: any = {
52-
status: isFinal ? status : "IN_PROGRESS",
52+
status: finalStatus ? finalStatus : "IN_PROGRESS",
5353
steps: [{
5454
id: stepId,
5555
status: status,
5656
userMessage: userMessage,
5757
systemMessage: systemMessage
58-
}]
58+
}],
59+
summary: summary
5960
};
6061

61-
if (isFinal) {
62-
data.summary = summary;
63-
}
64-
6562
core.debug(`Constructed data object: ${JSON.stringify(data)}`);
6663
console.log(`Constructed data object: ${JSON.stringify(data)}`);
6764

0 commit comments

Comments
 (0)