I have a Jenkins pipeline job, that check outs three repositories.
When the build fails, depending on where it fails, I want to send emails to the developers which caused the last commits/changes.
I can retrieve the authors full names with this:
def changeSet = script.currentBuild.changeSets[0];
Set authors = [];
if (changeSet != null) {
for (change in changeSet.items) {
authors.add(change.author.fullName)
}
}
But I cannot figure out:
- How can I get the authors email?
- How can I distinguish the authors for different repositories?