1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-09 04:42:20 +02:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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';
}