Condition in notifications seems to have no effect

I checked the config at https://config.travis-ci.com/explore and it passed, so the Travis is valid. I disabled a .yaml checker extension locally and that cleared up the issue there. However, with this implementation, notifications are being sent to Slack for both normal builds and cron jobs. It says in the documentation I linked to above that conditionals work in the notifications segment. Is the documentation out-of-date?

Hey @DevTroyer,

Can you show your .travis.yml file, or the relevant pieces of it, so I can help you?

I hit into the same problem. conditional notification does not work.

Here is part of my .travis.yml file. Whatever I set under slack, Travis will send notification on every branch I built.

notifications:
  slack:
#    if: branch = release-2 OR branch = release-3 OR branch = new OR branch =new-feature
#    if: branch IN (release-2, release-3, new, new-feature)
     if: branch = release-3
     secure:: xxxxx

I encountered this issue today as well. Any eta on a fix?

notifications:
  slack:
    if: type = api
    rooms:
      - xxxxx
    on_success: always
    on_failure: always
  email: false
1 Like