From 2e29e5ec7918c7102a11c847e78b4650b1de9dea Mon Sep 17 00:00:00 2001 From: fedor Date: Mon, 22 Apr 2024 05:18:16 -0400 Subject: [PATCH 1/2] Respect $HOME on macOS for caching Fixes #583 --- common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.js b/common.js index f15cf11f5..75c87d95f 100644 --- a/common.js +++ b/common.js @@ -265,7 +265,7 @@ function getDefaultToolCachePath() { if (platform.startsWith('ubuntu-')) { return '/opt/hostedtoolcache' } else if (platform.startsWith('macos-')) { - return '/Users/runner/hostedtoolcache' + return path.join(os.homedir(), 'hostedtoolcache') } else if (platform.startsWith('windows-')) { return 'C:\\hostedtoolcache\\windows' } else { From 6880e777190e60b2580dc71bb2c6474b8ce6861b Mon Sep 17 00:00:00 2001 From: fedor Date: Mon, 22 Apr 2024 05:26:13 -0400 Subject: [PATCH 2/2] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3989bbded..daf44d7b3 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,7 @@ if the [Runner Image](https://github.com/actions/runner-images) is very similar * Make sure to use the same operating system and version. * Make sure to use the same version of libssl. * Make sure that the operating system has `libyaml-0` and [`libgmp`](https://stackoverflow.com/questions/26555902/ruby-v-dyld-library-not-loaded-usr-local-lib-libgmp-10-dylib) installed -* The default tool cache directory (`/opt/hostedtoolcache` on Linux, `/Users/runner/hostedtoolcache` on macOS, +* The default tool cache directory (`/opt/hostedtoolcache` on Linux, `$HOME/hostedtoolcache` on macOS, `C:/hostedtoolcache/windows` on Windows) must be writable by the `runner` user. This is necessary since the Ruby builds embed the install path when built and cannot be moved around. * `/home/runner` must be writable by the `runner` user.