From f80cf827af18f99a9ed0a703eca2a35f9ceef2a9 Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 2 May 2023 12:55:33 +0200 Subject: [PATCH] [Fix] Reduce path names in runner --- src/runner.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runner.sh b/src/runner.sh index 21d187a..dc47114 100755 --- a/src/runner.sh +++ b/src/runner.sh @@ -199,8 +199,10 @@ process_request() ( fi # Clone repo and move into it. - rand="$(echo "${RANDOM}" | md5sum | head --bytes 32)" - repo_clone="${runner_cloning_dir}/${repo_name}-${repo_hash}-${rand}" + repo_id="$(echo "${repo_hash}" | head --bytes 7)" + [ "${repo_tag}" != "null" ] && repo_id="${repo_tag}" + rand="$(echo "${RANDOM}" | md5sum | head --bytes 7)" + repo_clone="${runner_cloning_dir}/${repo_name}-${repo_id}-${rand}" log_info "Clone '$repo_name'." if ! output="$(git clone "$repo_dir" "$repo_clone" 2>&1)"; then reply "${err_clone_repo}" "Cannot clone repo '${repo_name}': ${output}."