In Jenkins, How do I send emails only when the branch failed is the master branch?

theChosenOne

I want to write a script in pre-send script (from Editable-Email Notification plugin) to send the email (set the cancel flag to true) ONLY when the branch failed is a master branch (as in have master in the name of the branch). How do I do this?

DevD

How to trigger an email based on a specific condition for a successful build in Jenkins

your git plugin holds a env varible or you can make a env variable with branch name. then use the above solution to drop mail.

GIT Plugin provides you the env variable

GIT_BRANCH - Name of the remote repository (defaults to origin), followed by name of the branch currently being used, e.g. "origin/master" or "origin/foo"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I push a local Git branch to master branch in the remote?

Jenkins Bitbucket Branch Source Plugin how to build only master and PR?

How do I determine whether a branch is the default branch in a jenkins file?

I want to enable deployment only from the branch names(starting with hotfix and master). How can I do that?

How do I create release branch from master, excluding particular branch which is already merge in master

How to do Git Log see only merges to master branch?

How can I allow merging to master only from testing branch?

I cloned a remote branch. How do I checkout master?

How, do I update the master branch to point to the tip of another branch if the master has had no knew commits since the other branch diverged?

Refresh repo on a ubuntu server when master branch on GitHub is updated. How can I do this?

How do I catch a git branch up to master when it is both ahead and behind?

How do I create a master branch in a bare Git repository?

How do I safely merge a Git branch into master?

How do I add a git submodule that has no master branch?

How do Git branches work? Can I remove the master branch?

How do I rename my Git 'master' branch to 'release'?

How do I make a pull request from the master to the staging branch?

How do i clone work from the master branch to a new one?

How do I get a git conflict between a fork and the master branch

How do I pull changes from a branch in master to a subbranch?

How do I keep files in a branch if they are removed from master?

How do I undo a merge , after I merged a branch into master branch

How do I branch?

How will a branch off a branch look like when I do git branch -a?

How do I change a feature branch of a local git repo without changing the master branch?

How do I reset the git master branch to the upstream branch in a forked repository?

How do I update my feature branch commits to be on top of the updated master branch?

Git: How do I merge the remote branch of another developer's with my master branch?

Can I create a new branch on master when working on another branch?