fix: add support to pass tokens to GH from GHES

removing the logic that limits token authentication on GHES instances (this is a feature that GHES instances can use). Anyone (GHES or not) should be able to pass token as an input value and have it be used.
This commit is contained in:
Austin Sasko 2022-09-08 16:11:07 -04:00 committed by GitHub
parent 4c32251b06
commit 6591e26d40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@ import * as installer from './installer';
import * as semver from 'semver'; import * as semver from 'semver';
import path from 'path'; import path from 'path';
import {restoreCache} from './cache-restore'; import {restoreCache} from './cache-restore';
import {isGhes, isCacheFeatureAvailable} from './cache-utils'; import {isCacheFeatureAvailable} from './cache-utils';
import cp from 'child_process'; import cp from 'child_process';
import fs from 'fs'; import fs from 'fs';
import os from 'os'; import os from 'os';
@ -28,7 +28,7 @@ export async function run() {
if (versionSpec) { if (versionSpec) {
let token = core.getInput('token'); let token = core.getInput('token');
let auth = !token || isGhes() ? undefined : `token ${token}`; let auth = !token ? undefined : `token ${token}`;
const checkLatest = core.getBooleanInput('check-latest'); const checkLatest = core.getBooleanInput('check-latest');
const installDir = await installer.getGo( const installDir = await installer.getGo(