Workflow succeeded despite error code
I am writing a workflow that contains a series of commands in the command block. If the final command returns an error code, the workflow fails, but if an earlier command in the series returns an error, the workflow reports success, despite the error showing up in the log. Is there a way to get the workflow to stop execution and report failure at the first error?
Comments
1 comment
Hi Stephanie,
Thanks for writing in. I would suggest adding
set -o pipefail
at the top of your command block so the task exits with the return code for the last command that failed. For more information, see https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html.Best,
Samantha
Please sign in to leave a comment.