mirror of
https://github.com/actions/setup-python.git
synced 2025-06-16 09:17:14 +02:00
Implementation of python's caching (#266)
This commit is contained in:
@ -3,7 +3,7 @@ import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as exec from '@actions/exec';
|
||||
import {ExecOptions} from '@actions/exec/lib/interfaces';
|
||||
import {IS_WINDOWS, IS_LINUX} from './utils';
|
||||
import {IS_WINDOWS, IS_LINUX, isGhes} from './utils';
|
||||
|
||||
const TOKEN = core.getInput('token');
|
||||
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
|
||||
@ -71,10 +71,3 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
|
||||
core.info('Execute installation script');
|
||||
await installPython(pythonExtractedFolder);
|
||||
}
|
||||
|
||||
function isGhes(): boolean {
|
||||
const ghUrl = new URL(
|
||||
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
|
||||
);
|
||||
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||||
}
|
||||
|
Reference in New Issue
Block a user