我有一个Jenkins管道脚本。我正在使用the Bitbucket plugin来构建拉取请求。
在其中,我正在做两次结账。一个是工作而另一个不工作。
这个正在运作:
checkout([$class: 'GitSCM',
branches: [[name: "origin/${branchName}"]], doGenerateSubmoduleConfigurations: false,
extensions: [], gitTool: 'jgit', submoduleCfg: [],
userRemoteConfigs: [[credentialsId: credentials,
name: 'origin',
url: repository]]])
repository
,credentials
和branchName
是变量。
但是,这个不起作用:
checkout([$class: 'GitSCM',
branches: [[name: "origin/pr/${pullRequestId}/merge"]], doGenerateSubmoduleConfigurations: false,
extensions: [], gitTool: 'jgit', submoduleCfg: [],
userRemoteConfigs: [[credentialsId: credentials,
name: 'origin', refspec: '+refs/pull-requests/*:refs/remotes/origin/pr/*',
url: repository]]])
repository
,credentials
和pullRequestId
是变量。
错误讯息为Couldn't find any revision to build. Verify the repository and branch configuration for this job
。