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?
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With