From c4679e72ade76b3d5cbe007c81cadea558537f94 Mon Sep 17 00:00:00 2001 From: fedor Date: Tue, 25 Jul 2023 17:33:30 -0400 Subject: [PATCH] Respect username on macOS self-hosted runners Right now it's hardcoded to "runner" --- dist/setup/index.js | 2 +- src/setup-python.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 37b2479..4a64294 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -69859,7 +69859,7 @@ function run() { var _a; return __awaiter(this, void 0, void 0, function* () { if (utils_1.IS_MAC) { - process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + process.env['AGENT_TOOLSDIRECTORY'] = path.join(os.homedir(), 'hostedtoolcache'); } if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) { process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; diff --git a/src/setup-python.ts b/src/setup-python.ts index 88ffc10..c056eed 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -73,7 +73,7 @@ function resolveVersionInput() { async function run() { if (IS_MAC) { - process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + process.env['AGENT_TOOLSDIRECTORY'] = path.join(os.homedir(), 'hostedtoolcache'); } if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {