diff --git a/dist/setup/index.js b/dist/setup/index.js index f9cb76f10..84778361e 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -65340,13 +65340,9 @@ function resolveVersionInput() { function run() { var _a; return __awaiter(this, void 0, void 0, function* () { - // According to the README windows binaries do not require to be installed - // in the specific location, but Mac and Linux do - if (!utils_1.IS_WINDOWS && !((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) { - if (utils_1.IS_LINUX) - process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache'; - else - process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + // When setting AGENT_TOOLSDIRECTORY, the actions/tool-cache function find + // is not able to find the files cached by actions/python-version. + if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) { process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; } core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`); diff --git a/src/setup-python.ts b/src/setup-python.ts index 11ea40569..0be5acfac 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -7,9 +7,7 @@ import fs from 'fs'; import {getCacheDistributor} from './cache-distributions/cache-factory'; import { isCacheFeatureAvailable, - logWarning, - IS_LINUX, - IS_WINDOWS + logWarning } from './utils'; function isPyPyVersion(versionSpec: string) { @@ -68,11 +66,9 @@ function resolveVersionInput(): string { } async function run() { - // According to the README windows binaries do not require to be installed - // in the specific location, but Mac and Linux do - if (!IS_WINDOWS && !process.env.AGENT_TOOLSDIRECTORY?.trim()) { - if (IS_LINUX) process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache'; - else process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + // When setting AGENT_TOOLSDIRECTORY, the actions/tool-cache function find + // is not able to find the files cached by actions/python-version. + if (process.env.AGENT_TOOLSDIRECTORY?.trim()) { process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; } core.debug(