From c4679e72ade76b3d5cbe007c81cadea558537f94 Mon Sep 17 00:00:00 2001 From: fedor Date: Tue, 25 Jul 2023 17:33:30 -0400 Subject: [PATCH 1/2] 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 37b247905..4a642940e 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 88ffc1056..c056eede5 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()) { From 2750121aa7086e179d363170998d52ffface3559 Mon Sep 17 00:00:00 2001 From: fedor Date: Tue, 1 Aug 2023 10:51:33 -0600 Subject: [PATCH 2/2] Formatted code --- src/setup-python.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/setup-python.ts b/src/setup-python.ts index c056eede5..46aedde45 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -73,7 +73,10 @@ function resolveVersionInput() { async function run() { if (IS_MAC) { - process.env['AGENT_TOOLSDIRECTORY'] = path.join(os.homedir(), 'hostedtoolcache'); + process.env['AGENT_TOOLSDIRECTORY'] = path.join( + os.homedir(), + 'hostedtoolcache' + ); } if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {