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}."