How can the contents of Jenkins build workspace be sent as an email attachment, following a test run?. Below is my declarative pipeline code snippet. I can see the folders and files in the workspace following pipeline run, but it doesn't attach except the build log:-
stage('Send Test Report') {
steps {
script {
def testEmailGroup = "saba@abc.com"
// Test teams email
emailext(
subject: "STARTED: jOB '${env.JOB_NAME} [${env.BUILD_NUMBER}]' RESULT: ${currentBuild.currentResult}",
attachLog: true, attachmentsPattern: "**/${WORKSPACE}/*.zip",compressLog: true,
body: "Check console output at ${env.BUILD_URL}" ,
to: testEmailGroup)
}
}
}