From a6f96e7f30f41fe95afc7d4dbd257b93cbb3a2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Mon, 10 Jun 2024 11:25:18 +0300 Subject: [PATCH] fix(sync-files): keep original source file intact (#297) 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sync-files/action.yaml b/sync-files/action.yaml index 49b6c9ea..93289d61 100644 --- a/sync-files/action.yaml +++ b/sync-files/action.yaml @@ -103,7 +103,10 @@ runs: pre_commands=$(yq ".pre-commands" /tmp/file-config.yaml) post_commands=$(yq ".post-commands" /tmp/file-config.yaml) - modified_source_path="/tmp/repository/$source_path" + full_source_path="/tmp/repository/$source_path" + + modified_source_path=$(mktemp) + cp "$full_source_path" "$modified_source_path" pre_commands=$(echo "$pre_commands" | sed "s|{source}|$modified_source_path|g" | sed "s|{dest}|$dest_path|g") post_commands=$(echo "$post_commands" | sed "s|{source}|$modified_source_path|g" | sed "s|{dest}|$dest_path|g")