diff --git a/lib/constants.js b/lib/constants.js index dbaa4339..76caa83a 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -13,6 +13,7 @@ const { pusher, repository } = github.context.payload; exports.workspace = process.env.GITHUB_WORKSPACE; exports.folder = core.getInput("FOLDER", { required: true }); exports.root = "."; +exports.isTest = process.env.UNIT_TEST; // Required action data. exports.action = { build: exports.folder, diff --git a/lib/git.js b/lib/git.js index 162f333f..faa894fd 100644 --- a/lib/git.js +++ b/lib/git.js @@ -103,8 +103,8 @@ function deploy() { }); } const hasFilesToCommit = yield util_1.execute(`git status --porcelain`, temporaryDeploymentDirectory); - if (!hasFilesToCommit) { - console.log('There is nothing to commit. Exiting...'); + if (!hasFilesToCommit && !constants_1.isTest) { + console.log("There is nothing to commit. Exiting..."); return Promise.resolve(); } // Commits to GitHub.