refactor: perform shallow clone during deploy (#5748)

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Nathaniel Furniss 2021-10-20 06:21:11 -07:00 committed by GitHub
parent 02858ba79f
commit 6763496dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,9 @@ Try using DEPLOYMENT_BRANCH=main or DEPLOYMENT_BRANCH=master`);
const toPath = await fs.mkdtemp(
path.join(os.tmpdir(), `${projectName}-${deploymentBranch}`),
);
if (shellExecLog(`git clone ${remoteBranch} ${toPath}`).code !== 0) {
if (
shellExecLog(`git clone --depth 1 ${remoteBranch} ${toPath}`).code !== 0
) {
throw new Error(`Running "git clone" command in "${toPath}" failed.`);
}