title: How to prevent a step failing in Bitbucket Pipelines?
body: <p>I am running all my test cases and some of them get fail sometimes, pipeline detects it and fail the step and build. this blocks the next step to be executed (zip the report folder). I want to send that zip file as an email attachment.</p>
  <p>Here is my  <strong>bitbucket-pipelines.yml</strong> file</p>
  <pre class="lang-sh prettyprint-override"><code>custom: # Pipelines that can only be triggered manually
    QA2: # The name that is displayed in the list in the Bitbucket Cloud GUI
    - step:
        image: openjdk:8
        caches:
        - gradle
        size: 2x    # double resources available for this step to 8G
        script:
        - apt-get update
        - apt-get install zip
        - cd config/geb
        - ./gradlew -DBASE_URL=qa2 clean BSchrome_win **# This step fails** 
        - cd build/reports
        - zip -r testresult.zip BSchrome_winTest 
  
        after-script: # On test execution completion or build failure, send test report to e-mail lists
        - pipe: atlassian/email-notify:0.3.11
          variables:
            &lt;&lt;: *email-notify-config
            TO: 'email@email.com'
            SUBJECT: &quot;Test result for QA2 environment&quot;
            BODY_PLAIN: |
              Please find the attached test result report to the email.
            ATTACHMENTS: config/geb/build/reports/testresult.zip
  </code></pre>
  <p><img src="https://i.stack.imgur.com/Lb00e.png" alt="Screenshot of build failure" /></p>
  <p>The steps:</p>
  <pre><code>- cd build/reports 
  and
  - zip -r testresult.zip BSchrome_winTest
  </code></pre>
  <p>do not get executed because <code>- ./gradlew -DBASE_URL=qa2 clean BSchrome_win</code> failed</p>
  <p>I don't want bitbucket to fail the step and stop the Queue's step from executing.</p>