diff --git a/Jenkinsfile b/Jenkinsfile index d8c8fa212..390be194e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,12 +16,11 @@ try { node { stage ('Checkout') { checkout scm - echo env.GIT_COMMITTER_NAME - echo env.GIT_AUTHOR_NAME - echo env.GIT_USER - echo env.CHANGE_AUTHOR - echo env.CHANGE_AUTHOR_DISPLAY_NAME - echo env.CHANGE_AUTHOR_EMAIL + env.GIT_COMMIT_EMAIL = sh ( + script: "git --no-pager show -s --format='%ae'", + returnStdout: true + ).trim() + echo "Commiter: ${env.GIT_COMMIT_EMAIL}" } stage ('Build') { nodejs('node-lts') { @@ -56,13 +55,13 @@ try { } mail( - to: 'juan@verdnatura.es', + to: env.GIT_COMMIT_EMAIL, subject: "Pipeline success: ${env.JOB_NAME} (${env.BUILD_NUMBER})", body: "Check status at ${env.BUILD_URL}" ) } catch(e) { mail( - to: 'juan@verdnatura.es', + to: env.GIT_COMMIT_EMAIL, subject: "Pipeline failed: ${env.JOB_NAME} (${env.BUILD_NUMBER})", body: "Check status at ${env.BUILD_URL}" )