From 4f4cc91b88866b437bfe2858c016098bcff625d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 15 May 2019 17:43:09 +0200 Subject: [PATCH] use CHANGE_TARGET to rebase on actual PR target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ci/utils.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/utils.groovy b/ci/utils.groovy index 513cd2b44d..243aa34ab7 100644 --- a/ci/utils.groovy +++ b/ci/utils.groovy @@ -51,10 +51,14 @@ def doGitRebase() { println 'Skipping rebase due to release build...' return } + def rebaseBranch = 'develop' + if (CHANGE_TARGET) { /* This is available for PR builds */ + rebaseBranch = CHANGE_TARGET + } sh 'git status' - sh 'git fetch --force origin develop:develop' + sh "git fetch --force origin ${rebaseBranch}:${rebaseBranch}" try { - sh 'git rebase develop' + sh "git rebase ${rebaseBranch}" } catch (e) { sh 'git rebase --abort' throw e