# Feature to stop/fail a build forcefully based on certain condition

**URL:** <https://discuss.bitrise.io/t/feature-to-stop-fail-a-build-forcefully-based-on-certain-condition/10096>\
**Category:** Released\
**Created:** [September 3, 2019, 10:05am UTC](https://discuss.bitrise.io/t/feature-to-stop-fail-a-build-forcefully-based-on-certain-condition/10096 "2019-09-03T10:05:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gauravdalal](https://avatars.discourse-cdn.com/v4/letter/g/d2c977/32.png) [@gauravdalal](https://discuss.bitrise.io/u/gauravdalal)\
**Post date:** [September 3, 2019, 10:05am UTC](https://discuss.bitrise.io/t/feature-to-stop-fail-a-build-forcefully-based-on-certain-condition/10096/1 "2019-09-03T10:05:30Z")

</div>

## Description of the feature request

Need a feature to fail the build when some condition is fulfilled in shell script step, maybe via bitrise CLI i.e using $BITRISE\_BUILD\_STATUS variable or some other variable.

## Use case / for what or how I would use it

This is required in CI system integration where you can check the apk sizes between different builds created on various PR. Ex. You have bitrise as CI server and you want a check on build sizes between different PRs say every PR can increment a size max upto 250KB.  
This can also be used in CD system setup in similar way.

---

<div class="post-metadata">

**Author:** ![ahvth-bitrise](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/ahvth-bitrise/32/2468_2.png) [@ahvth-bitrise](https://discuss.bitrise.io/u/ahvth-bitrise)\
**Post date:** [September 3, 2019, 10:41am UTC](https://discuss.bitrise.io/t/feature-to-stop-fail-a-build-forcefully-based-on-certain-condition/10096/2 "2019-09-03T10:41:39Z")

</div>

Hi @gauravdalal, thank you so much for your feature request! 😄 Please make sure to place a vote on it as well to get the ball rolling.

---

<div class="post-metadata">

**Author:** ![damien.murphy](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/damien.murphy/32/4535_2.png) [@damien.murphy](https://discuss.bitrise.io/u/damien.murphy)\
**Post date:** [August 21, 2022, 10:50am UTC](https://discuss.bitrise.io/t/feature-to-stop-fail-a-build-forcefully-based-on-certain-condition/10096/3 "2022-08-21T10:50:42Z")

</div>

This can be achieved by running `exit 1` in a bash script step with some logic
