From 56d4ca7e6076705962b4c38cb6cffdd18b6abe38 Mon Sep 17 00:00:00 2001 From: James Ives Date: Fri, 27 Sep 2024 17:09:43 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20Production=20Code=20for=20Commit=209e2?= =?UTF-8?q?2cdce68ea8b14c332d042df497745aa97edff=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/git.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/git.js b/lib/git.js index a4957030e..03a0f5ab9 100644 --- a/lib/git.js +++ b/lib/git.js @@ -30,23 +30,12 @@ function init(action) { (0, core_1.info)(`Deploying using ${action.tokenType}… 🔑`); (0, core_1.info)('Configuring git…'); /** - * Add safe directory to the global git config. - */ - try { - yield (0, execute_1.execute)(`git config --global safe.directory '*'`, action.workspace, action.silent); - } - catch (_a) { - (0, core_1.info)('Unable to set workflow file tree as a safe directory…'); - } - /** - * Ensure that the workspace is a safe directory, this is somewhat redundant as the action - * will always set the workspace as a safe directory, but this is a fallback in case the action - * fails to do so. + * Ensure that the workspace is a safe directory. */ try { yield (0, execute_1.execute)(`git config --global --add safe.directory "${action.workspace}"`, action.workspace, action.silent); } - catch (_b) { + catch (_a) { (0, core_1.info)('Unable to set workspace as a safe directory…'); } yield (0, execute_1.execute)(`git config user.name "${action.name}"`, action.workspace, action.silent); @@ -63,7 +52,7 @@ function init(action) { throw new Error(); } } - catch (_c) { + catch (_b) { (0, core_1.info)('Unable to unset previous git config authentication as it may not exist, continuing…'); } try { @@ -72,7 +61,7 @@ function init(action) { throw new Error(); } } - catch (_d) { + catch (_c) { (0, core_1.info)('Attempted to remove origin but failed, continuing…'); } yield (0, execute_1.execute)(`git remote add origin ${action.repositoryPath}`, action.workspace, action.silent);