diff --git a/lib/git.js b/lib/git.js index 2b83ef58c..068656b1f 100644 --- a/lib/git.js +++ b/lib/git.js @@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@actions/core"); +const io_1 = require("@actions/io"); const execute_1 = require("./execute"); const util_1 = require("./util"); /* Initializes git in the workspace. */ @@ -143,9 +144,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. - yield execute_1.execute(`chmod u+w -R ${temporaryDeploymentDirectory}`, action.workspace); - yield execute_1.execute(`rm -rf ${temporaryDeploymentDirectory}`, action.workspace); + // Ensures the deployment directory is safely removed after each deployment. + yield io_1.rmRF(temporaryDeploymentDirectory); } }); }