diff --git a/build/ci/jenkins/PR.groovy b/build/ci/jenkins/PR.groovy index 7226ac3100..8dae319d07 100644 --- a/build/ci/jenkins/PR.groovy +++ b/build/ci/jenkins/PR.groovy @@ -192,20 +192,25 @@ pipeline { } } } - unsuccessful { - container('jnlp') { - script { - def authorEmail = sh returnStdout: true, script: 'git --no-pager show -s --format=\'%ae\' HEAD' - emailext subject: '$DEFAULT_SUBJECT', - body: '$DEFAULT_CONTENT', - recipientProviders: [developers(), culprits()], - replyTo: '$DEFAULT_REPLYTO', - to: "${authorEmail},devops@zilliz.com" - } + + } + } + } + } + post{ + unsuccessful { + container('jnlp') { + dir ('tests/scripts') { + script { + def authorEmail = sh(returnStdout: true, script: './get_author_email.sh ') + emailext subject: '$DEFAULT_SUBJECT', + body: '$DEFAULT_CONTENT', + recipientProviders: [developers(), culprits()], + replyTo: '$DEFAULT_REPLYTO', + to: "${authorEmail},devops@zilliz.com" } } } } } - } -} +} \ No newline at end of file diff --git a/tests/scripts/get_author_email.sh b/tests/scripts/get_author_email.sh new file mode 100755 index 0000000000..9937c24a01 --- /dev/null +++ b/tests/scripts/get_author_email.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e +function get_author_email(){ + email=$(git --no-pager show -s --format=\'%ae\' HEAD ) + if [[ "${email}" == 'nobody@nowhere' ]]; then + email=$(git --no-pager show -s --format=\'%ae\' HEAD^ ) + fi + echo ${email} | sed $'s/\'//g' +} +get_author_email \ No newline at end of file