Skip to content

Commit a0e040f

Browse files
committed
Tweak GHES fix to make it off by default
1 parent a0a4b55 commit a0e040f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

componentDetection.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ export default class ComponentDetection {
142142
private static async getLatestReleaseURL(): Promise<string> {
143143
var githubToken = core.getInput('token') || process.env.GITHUB_TOKEN || "";
144144

145-
// If the releaseServerUrl is github.com and Actions environment is GHES, then use an empty string as the token
146-
if (core.getInput('releaseServerUrl') != github.context.apiUrl) {
145+
// If the releaseServerUrl is set to a different value than the default, then use an empty string as the token
146+
if (core.getInput('releaseServerUrl') != null) {
147147
githubToken = "";
148148
}
149-
const octokit = github.getOctokit(githubToken, { baseUrl: core.getInput('releaseServerUrl') });
149+
const serverUrl = core.getInput('releaseServerUrl') || github.context.apiUrl;
150+
const octokit = github.getOctokit(githubToken, { baseUrl: serverUrl });
150151
const owner = "microsoft";
151152
const repo = "component-detection";
152153

0 commit comments

Comments
 (0)