因此,每个作业只能有一个Jenkins文件。我们与github的合并和公关webhooks共享同样的工作。我们如何才能轻松检测PR中的提交的webhook是否被推入PR合并?
答案 0 :(得分:1)
此(声明性管道)代码段可能会有所帮助:
stage('do something for PRs opened against develop branch') {
when {
changeRequest target: 'develop'
}
steps {
sh 'pr-worker.sh'
}
}
stage('do something on merge or direct commits to the develop branch') {
when {
branch 'develop'
}
steps {
sh 'develop-worker.sh'
}
}