Slack notifications on failed builds for specific branches

slack
notifications

#1

I’ve got the slack notifications working via the Project Settings and the failed builds flag works fine but I don’t really care if builds fail on the majority of branches because we have build status hooked up to pull requests I only care if the build is broken on master, stage or prod branches (ie. we need to get that fixed immediately!). Is there a way to only have it notify on those branches?


#2

This is where we stand on notifications on 2.0:


#3

So does that still run the build? Doesn’t say anything specifically about notifications?


#4

You’re right- I definitely messed up. Sorry about that! :frowning:

The 1.0 syntax is currently supported in the 2.0 so this works as expected;

notify:
    webhooks:
      - url: https://www.example.com/circleci/notify
    branches:
      only:
        - /.*/

Sorry again for my mistake.


#5

Cool thanks for that, is there a way to signal only to notify on failed/successful branches via the yml syntax? I can’t seem to find this syntax documented anywhere.

My objectives are:

  • Notify slack via webhook URL
  • Only on failed/first successful builds
  • Only for a subset of branches

I’m guessing this just goes in the root of the yml v2.0 file as well?

Thanks,
Alex


#6

Not at this time. You’d have to manually curl something for that to work.


#7

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