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);