Skip to content

Commit

Permalink
do shallow clone of repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nalandial committed Nov 22, 2023
1 parent b34d145 commit 02774c7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ executors:
DISABLE_SNAPSHOT_REQUIRE: 1

commands:
shallow_checkout:
description: Checkout the current branch with a shallow clone
steps:
- run:
name: Checkout current branch with a shallow clone
command: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" . --depth 1
# This command inserts SHOULD_PERSIST_ARTIFACTS into BASH_ENV. This way, we can define the variable in one place and use it in multiple steps.
# Run this command in a job before you want to use the SHOULD_PERSIST_ARTIFACTS variable.
setup_should_persist_artifacts:
Expand Down Expand Up @@ -1343,7 +1352,7 @@ jobs:
resource_class: << parameters.resource_class >>
steps:
- update_known_hosts
- checkout
- shallow_checkout
- install-required-node
- verify-build-setup:
executor: << parameters.executor >>
Expand Down

0 comments on commit 02774c7

Please sign in to comment.