How to cancel a build from within a script?


Is it possible to cancel a build (vs. having a build resulting in success or failure) when, during the build, we realize that we do not continue?

We use CircleCI for deployment, and we deploy to different servers based on Git branch. But many Git branches do not have a server configured for them yet we still get notifications in Slack from CircleCI saying that our build “failed.” Or course we could change it to “success” but our Slack is still littered with irrelevant CircleCI build notifications.

I am hoping there is a way to do this although I did not see any in the docs, and if not a way to do this I’m making a feature request.


I don’t think there is any facility for this (yet). I believe feature requests are welcome though.


Thanks for the reply. You are a great help here.


Here is the feature request Allow cancelling a build from within a script.

If anyone else has this need, please vote it up.