Implementation of python's caching (#266)

This commit is contained in:
Dmitry Shibanov
2021-11-17 13:31:22 +03:00
committed by GitHub
parent 52636cf49a
commit 280924fbef
75 changed files with 126753 additions and 7699 deletions

View File

@ -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';
}