From dcd51f2bce57775dd0ed3635266e4e6c648f4625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 7 Jun 2024 18:19:43 +0300 Subject: [PATCH] feat(sync-files): allow multiple destinations and speed up clone (#295) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- sync-files/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sync-files/action.yaml b/sync-files/action.yaml index 3708b119..49b6c9ea 100644 --- a/sync-files/action.yaml +++ b/sync-files/action.yaml @@ -91,10 +91,10 @@ runs: fi rm -rf /tmp/repository - git clone "$repository" /tmp/repository ${git_options[@]} + git clone --depth 1 "$repository" /tmp/repository ${git_options[@]} - for source_file in $(yq ".files[].source" /tmp/repo-config.yaml); do - yq ".files[] | select(.source == \"$source_file\")" /tmp/repo-config.yaml > /tmp/file-config.yaml + for file_config in $(yq ".files[].dest" /tmp/repo-config.yaml); do + yq ".files[] | select(.dest == \"$file_config\")" /tmp/repo-config.yaml > /tmp/file-config.yaml source_path=$(yq ".source" /tmp/file-config.yaml) dest_path=$(yq ".dest" /tmp/file-config.yaml)