title: How to trigger codefresh hooks based on condition
body: <p>I am trying to ensure that if our build fails we get notified by slack BUT only for our main branch.</p>
  <p>Here is our code for the slack notification:</p>
  <pre><code>hooks:
    on_fail:
      steps:
        notify:
          image: codefresh/slacknotifier
          environment:
            - SLACK_HOOK_URL=&lt;webhook url&gt;
            - SLACK_ATTACHMENTS=&lt;slack message&gt;
        when:
          branch:
            only:
              - /^(main)/i
  </code></pre>
  <p>At the minute it is still slacking for feature branches. Any assistance would be greatly appreciated.</p>