From 7063eebf04a332a3650790af33bf4e599a15b908 Mon Sep 17 00:00:00 2001 From: Wesley Cota Date: Sun, 30 Jan 2022 00:02:18 -0300 Subject: [PATCH] Add `--depth 1` to save time and bandwidth Since we need to download only the last snapshot, it is not necessary to download the full commits history. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 62b60d3..8987e62 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -34,7 +34,7 @@ git config --global user.email "$USER_EMAIL" git config --global user.name "$USER_NAME" { - git clone --single-branch --branch "$TARGET_BRANCH" "https://$USER_NAME:$API_TOKEN_GITHUB@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" "$CLONE_DIR" + git clone --single-branch --depth 1 --branch "$TARGET_BRANCH" "https://$USER_NAME:$API_TOKEN_GITHUB@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" "$CLONE_DIR" } || { echo "::error::Could not clone the destination repository. Command:" echo "::error::git clone --single-branch --branch $TARGET_BRANCH https://$USER_NAME:the_api_token@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git $CLONE_DIR"