From ea2412eeb2d1b05cd7e3f48473677eb9467350ec Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 24 Mar 2020 10:36:07 +0100 Subject: [PATCH] cpkg: set git identity before merge --- vars/cpkg.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vars/cpkg.groovy b/vars/cpkg.groovy index 1ae5e7d..dd51e39 100644 --- a/vars/cpkg.groovy +++ b/vars/cpkg.groovy @@ -31,11 +31,14 @@ def call(Map params = [:]) { // Merge currentRef into distBranch and push sh("git checkout -b '${distBranch}' 'origin/${distBranch}'") + + // Add git username/email + sh("git config user.email '${gitEmail}'") + sh("git config user.username '${gitUsername}'") + sh("git merge ${currentRef}") if (!skipPush) { - sh("git config user.email '${gitEmail}'") - sh("git config user.username '${gitUsername}'") sh("git push") } else { println("Skipping push. Set skipPush param to 'true' to enable remote repository update.")