From a0e040ff7b7a1e02681c1e1687702f2a2fe914a8 Mon Sep 17 00:00:00 2001 From: Justin Hutchings Date: Mon, 26 Aug 2024 21:30:17 +0000 Subject: [PATCH] Tweak GHES fix to make it off by default --- componentDetection.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/componentDetection.ts b/componentDetection.ts index dc9de4f..9f0c355 100644 --- a/componentDetection.ts +++ b/componentDetection.ts @@ -142,11 +142,12 @@ export default class ComponentDetection { private static async getLatestReleaseURL(): Promise { var githubToken = core.getInput('token') || process.env.GITHUB_TOKEN || ""; - // If the releaseServerUrl is github.com and Actions environment is GHES, then use an empty string as the token - if (core.getInput('releaseServerUrl') != github.context.apiUrl) { + // If the releaseServerUrl is set to a different value than the default, then use an empty string as the token + if (core.getInput('releaseServerUrl') != null) { githubToken = ""; } - const octokit = github.getOctokit(githubToken, { baseUrl: core.getInput('releaseServerUrl') }); + const serverUrl = core.getInput('releaseServerUrl') || github.context.apiUrl; + const octokit = github.getOctokit(githubToken, { baseUrl: serverUrl }); const owner = "microsoft"; const repo = "component-detection";