Support AGENT_TOOLSDIRECTORY as in setup-python action

This commit is contained in:
thangle 2024-05-10 12:14:03 +01:00
parent c2ac33f2c6
commit c1b361d808
No known key found for this signature in database
GPG key ID: 1055755EA3C5002E
2 changed files with 13 additions and 0 deletions

5
dist/setup/index.js vendored
View file

@ -94211,6 +94211,7 @@ const util_1 = __nccwpck_require__(2629);
const constants_1 = __nccwpck_require__(9042); const constants_1 = __nccwpck_require__(9042);
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
var _a;
try { try {
// //
// Version is optional. If supplied, install / use from the tool cache // Version is optional. If supplied, install / use from the tool cache
@ -94227,6 +94228,10 @@ function run() {
if (!arch) { if (!arch) {
arch = os_1.default.arch(); arch = os_1.default.arch();
} }
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(`Node is expected to be installed into ${process.env['RUNNER_TOOL_CACHE']}`);
if (version) { if (version) {
const token = core.getInput('token'); const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`; const auth = !token ? undefined : `token ${token}`;

View file

@ -33,6 +33,14 @@ export async function run() {
arch = os.arch(); arch = os.arch();
} }
if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
}
core.debug(
`Node is expected to be installed into ${process.env['RUNNER_TOOL_CACHE']}`
);
if (version) { if (version) {
const token = core.getInput('token'); const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`; const auth = !token ? undefined : `token ${token}`;