Skip to content

Commit cf2f22a

Browse files
Merge pull request #3 from meshcloud/feature/validate-step-id
feat: validate setting stepId when setting step property
2 parents 16aaa36 + 6b87a8e commit cf2f22a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

dist/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28045,6 +28045,11 @@ async function run() {
2804528045
core.setFailed(error instanceof Error ? error.message : 'Unknown error occurred while parsing outputs_json');
2804628046
return;
2804728047
}
28048+
// when the user attempst to only resolve the run, provide a failure message
28049+
if ((stepStatus || userMessage || systemMessage || outputsJsonInput) && !stepId) {
28050+
core.setFailed('step_id must be provided when setting step_status, user_message, system_message, or outputs_json');
28051+
return;
28052+
}
2804828053
const tempDir = process.env.RUNNER_TEMP || os.tmpdir();
2804928054
core.debug(`Temporary directory: ${tempDir}`);
2805028055
console.log(`Temporary directory: ${tempDir}`); // This will also print the path to the console

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ async function run() {
3939
return;
4040
}
4141

42+
// when the user attempst to only resolve the run, provide a failure message
43+
if ((stepStatus || userMessage || systemMessage || outputsJsonInput) && !stepId) {
44+
core.setFailed('step_id must be provided when setting step_status, user_message, system_message, or outputs_json');
45+
return;
46+
}
47+
4248
const tempDir = process.env.RUNNER_TEMP || os.tmpdir();
4349
core.debug(`Temporary directory: ${tempDir}`);
4450
console.log(`Temporary directory: ${tempDir}`); // This will also print the path to the console

0 commit comments

Comments
 (0)