From 5df73db307ccada957fe9957f20a93cae31f341b Mon Sep 17 00:00:00 2001 From: James Ives Date: Sun, 24 May 2020 11:18:50 -0400 Subject: [PATCH] Update git.js --- lib/git.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/git.js b/lib/git.js index b34ad477..cf96a93f 100644 --- a/lib/git.js +++ b/lib/git.js @@ -132,8 +132,6 @@ function deploy(action) { yield execute_1.execute(`git commit -m "${commitMessage}" --quiet`, `${action.workspace}/${temporaryDeploymentDirectory}`); yield execute_1.execute(`git push --force ${action.repositoryPath} ${temporaryDeploymentBranch}:${action.branch}`, `${action.workspace}/${temporaryDeploymentDirectory}`); core_1.info(`Changes committed to the ${action.branch} branch… 📦`); - // Cleans up temporary files/folders and restores the git state. - core_1.info('Running post deployment cleanup jobs…'); if (action.singleCommit) { yield execute_1.execute(`git fetch ${action.repositoryPath}`, action.workspace); yield execute_1.execute(`git checkout --orphan ${action.branch}-temp`, `${action.workspace}/${temporaryDeploymentDirectory}`); @@ -150,7 +148,8 @@ function deploy(action) { throw new Error(`The deploy step encountered an error: ${util_1.suppressSensitiveInformation(error.message, action)} ❌`); } finally { - // Ensures the deployment directory is safely removed after each deployment. + // Cleans up temporary files/folders and restores the git state. + core_1.info('Running post deployment cleanup jobs… 🗑️'); yield execute_1.execute(`git worktree remove ${temporaryDeploymentDirectory}`, action.workspace); yield io_1.rmRF(temporaryDeploymentDirectory); }