目前我知道可以使用 GitHub pull request builder plugin 更改上下文消息.但由于目前,由于我们拥有大量存储库,我只在 Jenkins 上使用 GitHub Organization 项目,是否可以通过声明性管道更改上下文消息?
预期:
最佳答案
解决方法:
pipeline {
agent any
stages {
stage("Stage #1") {
steps {
sh 'ls'
githubNotify gitApiUrl: 'https://github.mycompany.com/api/v3', context: 'something test', description: 'This commit is being built', status: 'PENDING'
}
}
}
post {
success {
githubNotify gitApiUrl: 'https://github.mycompany.com/api/v3', context: 'something test', description: 'It works', status: 'SUCCESS'
}
failure {
githubNotify gitApiUrl: 'https://github.mycompany.com/api/v3', context: 'something test', description: 'This commit cannot be built', status: 'FAILED'
}
}
}
使用的插件:https://github.com/jenkinsci/pipeline-githubnotify-step-plugin
关于jenkins - 如何使用声明性管道更改多分支项目的上下文消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50556292/