diff --git a/dist/setup/index.js b/dist/setup/index.js index e4e670836..a9d9214a0 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -6078,7 +6078,15 @@ function cacheDependencies(cache, pythonVersion) { }); } function run() { + var _a; return __awaiter(this, void 0, void 0, function* () { + if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) { + core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`); + process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; + } + else { + core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`); + } try { const version = core.getInput('python-version'); if (version) { diff --git a/src/setup-python.ts b/src/setup-python.ts index 2f946578e..62c76dba9 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -22,6 +22,16 @@ async function cacheDependencies(cache: string, pythonVersion: string) { } async function run() { + if (process.env.AGENT_TOOLSDIRECTORY?.trim()) { + core.debug( + `Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}` + ); + process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; + } else { + core.debug( + `Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}` + ); + } try { const version = core.getInput('python-version'); if (version) {