diff --git a/dist/setup/index.js b/dist/setup/index.js index 74dfe4689..1146f32ae 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -65278,11 +65278,10 @@ function resolveVersionInput() { function run() { var _a; return __awaiter(this, void 0, void 0, function* () { - // This aligns us with actions/setup-python, which defaults their - // internal TOOLCACHE_ROOT to RUNNER_TOOL_CACHE when AGENT_TOOLSDIRECTORY - // is not set. - if (!((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) { - process.env['AGENT_TOOLSDIRECTORY'] = process.env['RUNNER_TOOL_CACHE']; + // 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']}`); try { diff --git a/src/setup-python.ts b/src/setup-python.ts index 630af6e66..5426081f3 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -61,11 +61,10 @@ function resolveVersionInput(): string { } async function run() { - // This aligns us with actions/setup-python, which defaults their - // internal TOOLCACHE_ROOT to RUNNER_TOOL_CACHE when AGENT_TOOLSDIRECTORY - // is not set. - if (!process.env.AGENT_TOOLSDIRECTORY?.trim()) { - process.env['AGENT_TOOLSDIRECTORY'] = process.env['RUNNER_TOOL_CACHE']; + // 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( `Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`