How to restrict build failure emails to only a specific branch in travis CI?

user9920500

I have email and slack notifications configured for travis build failures. Currently It sends notifications for build failure of every branch. Since every developer does creates lot of branches, the mails come in a large number which sound like spam. I would want to restrict the mails only for failures of develop branch.

My configuration in .travis.yml is something like this.

notifications:
   email:
    recipients:
     - [email protected]
    branches:
      only: develop
    on_success: change
    on_failure: always

Is this branch specific alerts are really supported, if yes how do you do it ?

Madhu Bhat

For your specific query about if branch specific notification is supported by Travis currently, the answer is NO. Below is from the Travis documentation:

There is currently no way of limiting the notification to a specific branch, but the payload will contain all relevant data to do so at the receiving end

So currently the branch specific notification is not supported by Travis, but would need to be implemented separately by consuming the webhook payload from Travis.

Update: (Courtesy @LucasCimon) There is an open GitHub issue to track this feature request.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

trigger travis CI build only with specific commit message

How to run a command only if is the master branch in travis-ci?

Travis CI: branch filters in build matrix items

Build Fails With Spread Operator on Travis CI Only

How to make travis ci build failing graphic different for each git branch

Travis CI Build failure due to failed to execute openssl command

Break Travis-CI build on dotnet test failure

How to build MacOSX executables on Travis CI?

How to build on travis-ci with gradle and cobertura

Travis CI + Go: creating a specific build flow for different OS

Build webpack on travis ci

Travis build only fails for main repo master branch

Jenkins - how to build a specific branch

Travis CI to modify same branch

Run a build step on a specific branch only

GitLab CI: only trigger only merge request & specific branch

How to take a specific action only when manually triggering a build using Travis

Installing specific R package from specific branch from github repo on travis-ci

Travis-CI build failure "The type or namespace name 'Extensions' does not exist in the namespace"

Travis CI Build failure with JDK 1.8.60, Maven 3.1.1 and maven-plugin-plugin

Manually trigger a build for a branch outside of the safelist (or within blocklist) in travis-ci

gitlab ci yml run specific stage for release candidate branch only

Travis conditional build - How to skip deploy stage except master branch

How to configure Travis CI to build Node.js without tests?

How do I build Python 3.8 on Travis CI?

How can I run a script as part of a Travis CI build?

How to get Travis CI to build and test xcode projects hosted on Github?

How to setup webdriverio related tests to be build in travis-ci

How to deploy a successful build using Travis CI and Scalr