我们在Jenkins中使用GitHub Branch Source Plugin。它很棒。但是它会扫描分支和拉取请求。
我们希望以仅扫描拉取请求的方式配置插件。这可能吗?如果没有,我们可以在哪里发布我们的功能请求?
祝你好运, 马里努斯
答案 0 :(得分:2)
答案 1 :(得分:0)
使用 JCaSC / DSL 语法,可以使用 gitHubBranchDiscovery
trait 和 strategyId(1)
进行配置:
branchSource {
source {
github {
id('ci') // IMPORTANT: use a constant and unique identifier
repositoryUrl('https://github.com/OWNER/REPO')
repository('REPO')
repoOwner('OWNER')
apiUri('https://github.com/api/v3')
configuredByUrl(false)
credentialsId('github-token')
traits {
gitHubBranchDiscovery {
// 1 = Exclude branches that are also filed as PRs
// 2 = Only branches that are also filed as PRs
// 3 = All branches
strategyId(1)
}
gitHubPullRequestDiscovery {
// 1 = only PR merge
// 2 = only PR head
// 3 = both PR head and PR merge
strategyId(3) // 3 = both PR head and PR merge from origin
}
}
}
}
}