From 42d072b8188af5f82b1f8f4fdbc2f824ed9daf83 Mon Sep 17 00:00:00 2001 From: Daniel Ventura Date: Fri, 18 Nov 2022 15:58:01 +0000 Subject: [PATCH] #296 added user.email and user.name values in process envs and its logic to set the user.email and user.name in global gitconfig --- copado-function/app/Init.fn.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/copado-function/app/Init.fn.js b/copado-function/app/Init.fn.js index 0246018..4d62555 100644 --- a/copado-function/app/Init.fn.js +++ b/copado-function/app/Init.fn.js @@ -26,6 +26,9 @@ CONFIG.mcdevVersion = process.env.mcdev_version; // this will only be needed if CONFIG.metadataFilePath = null; // do not change - LWC depends on it! // not needed in this case, previous value: 'mcmetadata.json' CONFIG.source_mid = null; CONFIG.tmpDirectory = '../tmp'; +CONFIG.userEmail = process.env.git_email; +CONFIG.userName = process.env.git_name; + // retrieve CONFIG.source_sfid = null; // commit @@ -108,15 +111,17 @@ async function run() { try { Log.info(''); - Log.info('Adding git email'); + Log.info('Adding git email and name'); Log.info('==================='); - Util.execCommand(null, [`git config --global user.email "${CONFIG.gitEmail}"`]); Log.info(''); + Util.execCommand(null, [ + `git config --global user.email "${CONFIG.userEmail}"`, + `git config --global user.name "${CONFIG.userName}"`, + ]); } catch (ex) { - Log.error('adding git email failed: ' + ex.message); + Log.error('adding git email and name failed: ' + ex.message); throw ex; } - try { Log.info(''); Log.info('Preparing');