目前,我知道可以使用GitHub pull request builder plugin更改上下文消息。但是从目前开始,由于我们拥有大量的存储库,我只在Jenkins上使用GitHub Organization项目,可以通过声明性管道更改上下文消息吗?
预期:
答案 0 :(得分:0)
解决:
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