diff --git a/build/ci/jenkins/PR.groovy b/build/ci/jenkins/PR.groovy index 7226ac310060b269bc154bbedd35abc5d566a59b..8dae319d075e9ad21a0712a209c8cc7d50781891 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 0000000000000000000000000000000000000000..9937c24a01cf3bd9f9c8043bba1f67eb9f4708bd --- /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