I am trying to ensure that if our build fails we get notified by slack BUT only for our main branch.
Here is our code for the slack notification:
hooks:
on_fail:
steps:
notify:
image: codefresh/slacknotifier
environment:
- SLACK_HOOK_URL=<webhook url>
- SLACK_ATTACHMENTS=<slack message>
when:
branch:
only:
- /^(main)/i
At the minute it is still slacking for feature branches. Any assistance would be greatly appreciated.
Stephen, I'm wondering if it was a bug that has been fixed as I ran pretty much the same code(same condition at least)
and it worked as expected for me
When I'm not on main, I can see in the log:
Maybe the notification was coming from the user notification setting (https://g.codefresh.io/user/settings) or the Slack integration setting (https://g.codefresh.io/account-admin/account-conf/integration/slack)