# Run Steps Only On Failed Builds

**URL:** <https://discuss.bitrise.io/t/run-steps-only-on-failed-builds/13611>\
**Category:** Builds\
**Created:** [July 13, 2020, 1:03pm UTC](https://discuss.bitrise.io/t/run-steps-only-on-failed-builds/13611 "2020-07-13T13:03:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akoon](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@akoon](https://discuss.bitrise.io/u/akoon)\
**Post date:** [July 13, 2020, 1:03pm UTC](https://discuss.bitrise.io/t/run-steps-only-on-failed-builds/13611/1 "2020-07-13T13:03:46Z")

</div>

# Bitrise Build Issue Report template

## Description of the issue

I am trying to send a slack message, but only want to do so on failed builds. I have found other forums saying to use

> run\_if: “.IsBuildFailed”

But we are still getting slack notifications when no build steps fail (successful build). I tried adding the

> is\_always\_run: true

condition as some suggested, but it had no affect either.

## Environment:

> **[Continuous Integration and Delivery (CI/CD) Platform | Bitrise](https://bitrise.io)**
>
> Streamline your mobile development process with Bitrise. The Mobile DevOps platform that helps you build, test, and deploy your apps quickly and reliably.

This is happening on the Android/Linux stack and the XCode 11.5.x Catalina stack.

**Which build Step causes the issue and which version of the step?**

This is happening for the Slack Message step but seems to be a larger issue of only running a step if a previous step has failed the build.

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : NO
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : NO
- _Does the issue happen sporadically, or every time?_ : Every time
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ : Always happened

## Build log

Here is the bitrise.yml for the step.

> slack-testing:  
> steps:  
> - slack@3:  
> inputs:  
> - channel: “#some-channel”  
> - from\_username: Bitrise Testing  
> - fields: |  
> Branch|${BITRISE\_GIT\_BRANCH}  
> Workflow|${BITRISE\_TRIGGERED\_WORKFLOW\_ID}  
> - buttons: |  
> View Build|${BITRISE\_BUILD\_URL}  
> Install Page|${BITRISE\_PUBLIC\_INSTALL\_PAGE\_URL}  
> - channel\_on\_error: “#some-channel”  
> - from\_username\_on\_error: Bitrise Testing  
> - color\_on\_error: “#dc1414”  
> - webhook\_url: “$SLACK\_TESTING\_WEBHOOK”  
> run\_if: “.IsBuildFailed”

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [August 12, 2020, 1:03pm UTC](https://discuss.bitrise.io/t/run-steps-only-on-failed-builds/13611/2 "2020-08-12T13:03:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
