diff --git a/Jenkinsfile b/Jenkinsfile index f67dde9..0ff7210 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,8 +103,14 @@ pipeline { // get mail addresses metadata = readFile(file: "${env.GIT_PATH}metadata.yaml").split('\n').each { line -> if(line.contains("- build-notification:")) { + // remove yaml comments + if(line.contains('#')) { + line = line.substring(0, line.indexOf('#')) + } def mailMatch = line =~ /[_A-Za-z0-9-]+(.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(.[A-Za-z0-9]+)*(.[A-Za-z]{2,})/ - env.RECIPIENTS += (mailMatch[0][0] + ";") + if(mailMatch) { + env.RECIPIENTS += (mailMatch[0][0] + ";") + } } } }