Jenkins獲取提交信息
利用腳本查出提交信息。例如git log --oneline
獲取提交描述信息,將其負值給env對象
stages {
stage("stage 1: Test dingding notify") {
steps {
echo 'Test dingding notify'
script {
env.commit = "${sh(script:'git log --oneline --no-merges|head -1', returnStdout: true)}"
sh "env"
}
}
}
}