From 36fada698186392af00be996cf6445d2b08f5f93 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 11 Jun 2025 14:57:09 +0530 Subject: [PATCH] Fix tool-cache directory on self-hosted runners --- src/scripts/darwin.sh | 2 +- src/scripts/linux.sh | 1 + src/scripts/unix.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 7a290c05..800d3969 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -212,7 +212,7 @@ get_scan_dir() { # Function to handle self-hosted runner setup. self_hosted_helper() { - : + sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true } # Function to Setup PHP. diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 4a424117..8a7bfc48 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -20,6 +20,7 @@ self_hosted_helper() { sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit fi + sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg } diff --git a/src/scripts/unix.sh b/src/scripts/unix.sh index ae9ebe97..51d0f4bb 100644 --- a/src/scripts/unix.sh +++ b/src/scripts/unix.sh @@ -221,7 +221,7 @@ self_hosted_setup() { exit 1 else self_hosted_helper >/dev/null 2>&1 - add_env RUNNER_TOOL_CACHE /tmp + add_env RUNNER_TOOL_CACHE /opt/hostedtoolcache fi fi }