Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure workflow status failure if command fails in backendless mode (#…
…1760) Fixes #1658 Error handling in backendless mode was incorrect, resulting in the workflow exit status to be success even if the command execution failed. This patch addresses this issue. The following are some additional notes of this fix: - When `allAppliesSuccessful` is false, we need to call `ReportErrorAndExit()` to ensure that the workflow fails with a non-zero exit status. - Since `ReportErrorAndExit()` invokes `os.Exit()` immediately, it should be called after setting the status of the pull request. - Contrary to intuition, `atLeastOneApply` is counted even if plan command, so we need to use `scheduler.IsPlanJobs()` to determine if the current workflow is plan or apply.
- Loading branch information