-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
If you do the following in your workflow:
throw new Error('');The deploy is treated as successful.
Why does this matter? A lot of tasks fail without writing anything to stderr, e.g. sst deploy itself.
As a result, if you do await $`pnpm sst deploy` we write an empty string to WORKFLOW_RESULT file:
console/packages/build/buildspec/index.mjs
Lines 383 to 386 in 6ef9bf9
| ` const result = e.name === "ShellError"`, | |
| ` ? { error: e.stderr.toString().trim() }`, | |
| ` : { error: e.message };`, | |
| ` fs.writeFileSync("${WORKFLOW_RESULT}", JSON.stringify(result));`, |
That gets transformed into an Error with an empty message here:
console/packages/build/buildspec/index.mjs
Lines 395 to 400 in 6ef9bf9
| try { | |
| shellError = new Error( | |
| JSON.parse(fs.readFileSync(WORKFLOW_RESULT, "utf8")).error, | |
| ); | |
| } catch (_) {} | |
| throw shellError; |
As a result, even if sst deploy fails (or astro check or tsc --noEmit etc.) the deploy is treated as successful. Furthermore, steps following the error don't run.
Metadata
Metadata
Assignees
Labels
No labels

