diff --git a/setup.sh b/setup.sh index d23f205..4c5b182 100644 --- a/setup.sh +++ b/setup.sh @@ -268,7 +268,13 @@ setup_role() { return fi TEMP_DIR=$(mktemp -d) - run "Cloning role repository" git clone --depth=1 "$REPO_URL" "$TEMP_DIR" + # run "Cloning role repository" git clone --depth=1 "$REPO_URL" "$TEMP_DIR" + run "Cloning role repository (sparse)" bash -c " + git --config-env=http.https://github.com/.extraheader=GH_AUTH_HEADER \ + clone --depth=1 --filter=blob:none --sparse "$REPO_URL" "$TEMP_DIR" && + git -C "$TEMP_DIR" sparse-checkout set "$ROLE" +" + ROLE_SRC="$TEMP_DIR/$ROLE" if [[ ! -d "$ROLE_SRC" ]]; then log "WARN: role directory $ROLE_SRC not found after clone, skipping"