diff --git a/lib/git.js b/lib/git.js index 78b07af6..4f2850da 100644 --- a/lib/git.js +++ b/lib/git.js @@ -87,6 +87,8 @@ function deploy() { yield util_1.execute(`git switch ${constants_1.action.baseBranch || "master"}`, constants_1.workspace); yield util_1.execute(`git fetch origin`, constants_1.workspace); yield util_1.execute(`git worktree add --checkout ${temporaryDeploymentDirectory} origin/${constants_1.action.branch}`, constants_1.workspace); + // Removes the git folder prior to moving. + yield io_1.rmRF(`${constants_1.action.build}/.git`); /* Pushes all of the build files into the deployment directory. Allows the user to specify the root if '.' is provided. */ diff --git a/src/git.ts b/src/git.ts index d3e06e97..12123f3f 100644 --- a/src/git.ts +++ b/src/git.ts @@ -1,5 +1,5 @@ import * as core from "@actions/core"; -import { cp } from "@actions/io"; +import { cp, rmRF } from "@actions/io"; import { execute } from "./util"; import { workspace, action, repositoryPath } from "./constants"; @@ -81,6 +81,9 @@ export async function deploy(): Promise { workspace ); + // Removes the git folder prior to moving. + await rmRF(`${action.build}/.git`) + /* Pushes all of the build files into the deployment directory. Allows the user to specify the root if '.' is provided. */