mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-08 12:28:20 +02:00
Merge pull request #394 from akv-platform/v-sedoli/set-env-by-default
Assign default value of AGENT_TOOLSDIRECTORY if not set
This commit is contained in:
commit
364e819741
3 changed files with 18 additions and 15 deletions
13
dist/setup/index.js
vendored
13
dist/setup/index.js
vendored
|
@ -65287,13 +65287,16 @@ function resolveVersionInput() {
|
|||
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']}`);
|
||||
// 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';
|
||||
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']}`);
|
||||
}
|
||||
core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`);
|
||||
try {
|
||||
const version = resolveVersionInput();
|
||||
if (version) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue