I am running my sfdx deploy command in a shell script as part of a Github action. Currently, the script is reporting success even if the sfdx command fails. This means the build is succeeding even when it fails.
How can I query the result of the sfdx command (
force:source:deploy with tests run) and fail the script and have a failed build reported when the deploy command fails?
Here are the lines of code in my shell script:
sfdx force:source:deploy -x $DEPLOY_FOLDER/package/package.xml --verbose -c -l RunSpecifiedTests -r $testsToRun echo -e "Deployment to [$targetEnv] successful."
And here is the end of the output from the script as seen in Github:
ERROR running force:source:deploy: Deploy failed. ----> Deployment to [localBuild] successful.
Thanks in advance, Peter