Fail build when post-receive hook fails

I’m pushing result of the build to the private repo and running some post-deployment steps via post-receive hook. Is there a way to let build fail, when this script fails?

I can imagine pushing back to Github if everything went fine and starting a new workflow run that way, but that seems to be wasteful…

Another way could probably be setting up some value, which could be fetched using HTTP request made from the GA build. This seems to be too complicated as well.


If the build job in a workflow run has completed, we have no any available method to changed the status of the job.

Maybe you can try re-running the workflow. You can try to add some steps in the workflow to monitor the result of the script in the post-deployment steps. When re-running the the workflow, if the script fails, let the build fails.

Thanks. It seems to me that is the way to go if I want to start another workflow only if post-receive script ended successfully. It’s shame that there’s now way to set status of workflow run through the API.