From 3d24d99ffb27582c399d9fcfd266d630a1194f63 Mon Sep 17 00:00:00 2001 From: Morgan Davies Date: Thu, 8 Oct 2020 16:27:53 +0100 Subject: [PATCH] Only checkout specfied branch --- .../regeneration/build_pipeline_generator.groovy | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pipelines/build/regeneration/build_pipeline_generator.groovy b/pipelines/build/regeneration/build_pipeline_generator.groovy index c6cb7924c6..061e6fc19c 100644 --- a/pipelines/build/regeneration/build_pipeline_generator.groovy +++ b/pipelines/build/regeneration/build_pipeline_generator.groovy @@ -45,7 +45,17 @@ node('master') { disableJob : false, triggerSchedule : "" ]; - checkout([$class: 'GitSCM', userRemoteConfigs: [[url: config.GIT_URL]]]) + checkout( + [ + $class: 'GitSCM', + userRemoteConfigs: [ + [ + url: config.GIT_URL, + refspec: "+refs/heads/${config.BRANCH}:refs/remotes/origin/${config.BRANCH}" + ] + ] + ] + ) def target; try {