Skip to content

Commit 91712e1

Browse files
Merge pull request actions#338 from akv-demo/main
Force TOOLCACHE_ROOT to be equal AGENT_TOOLSDIRECTORY
2 parents 98f2ad0 + f4b66de commit 91712e1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Diff for: dist/setup/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -6083,7 +6083,15 @@ function cacheDependencies(cache, pythonVersion) {
60836083
});
60846084
}
60856085
function run() {
6086+
var _a;
60866087
return __awaiter(this, void 0, void 0, function* () {
6088+
if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) {
6089+
core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`);
6090+
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
6091+
}
6092+
else {
6093+
core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`);
6094+
}
60876095
try {
60886096
const version = core.getInput('python-version');
60896097
if (version) {

Diff for: src/setup-python.ts

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
2222
}
2323

2424
async function run() {
25+
if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
26+
core.debug(
27+
`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}`
28+
);
29+
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
30+
} else {
31+
core.debug(
32+
`Python is expected to be installed into RUNNER_TOOL_CACHE==${process.env['RUNNER_TOOL_CACHE']}`
33+
);
34+
}
2535
try {
2636
const version = core.getInput('python-version');
2737
if (version) {

0 commit comments

Comments
 (0)