Clean up code

This commit is contained in:
Justin Hutchings
2024-08-26 23:22:50 +00:00
committed by GitHub
parent 6b81b8e569
commit 8ad6ba7803
3 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -143,18 +143,18 @@ export default class ComponentDetection {
private static async getLatestReleaseURL(): Promise<string> {
var githubToken = core.getInput('token') || process.env.GITHUB_TOKEN || "";
// If the releaseServerUrl is set to a different value than the default, then use an empty string as the token
// If the releaseServerUrl is set, then use an empty string as the token
if (core.getInput('releaseServerUrl') != null) {
githubToken = "";
}
const serverUrl = core.getInput('releaseServerUrl') || github.context.apiUrl;
//const octokit = github.getOctokit(githubToken, { baseUrl: serverUrl });
const octokit = new Octokit({ auth: githubToken, baseUrl: serverUrl, request: { fetch: fetch}, log: {
debug: core.debug,
info: core.info,
warn: core.warning,
error: core.error
}, });
const owner = "microsoft";
const repo = "component-detection";
core.debug("Attempting to download latest release from " + serverUrl);
Generated Vendored
+1 -2
View File
@@ -24969,12 +24969,11 @@ class ComponentDetection {
static getLatestReleaseURL() {
return __awaiter(this, void 0, void 0, function* () {
var githubToken = core.getInput('token') || process.env.GITHUB_TOKEN || "";
// If the releaseServerUrl is set to a different value than the default, then use an empty string as the token
// If the releaseServerUrl is set, then use an empty string as the token
if (core.getInput('releaseServerUrl') != null) {
githubToken = "";
}
const serverUrl = core.getInput('releaseServerUrl') || github.context.apiUrl;
//const octokit = github.getOctokit(githubToken, { baseUrl: serverUrl });
const octokit = new octokit_1.Octokit({ auth: githubToken, baseUrl: serverUrl, request: { fetch: cross_fetch_1.default }, log: {
debug: core.debug,
info: core.info,
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long