Skip to content

Commit 7f6325b

Browse files
committed
formatting
1 parent 8983391 commit 7f6325b

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

ado-index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ async function run() {
1616
// Validate required inputs
1717
const githubRepository = platform.input.getInput("githubRepository");
1818
const githubToken = platform.input.getInput("token");
19-
19+
2020
if (!githubRepository) {
2121
platform.logger.setFailed("githubRepository input is required. Please provide the GitHub repository in format 'owner/repo'");
2222
return;
2323
}
24-
24+
2525
if (!githubToken) {
2626
platform.logger.setFailed("token input is required. Please provide a GitHub Personal Access Token with 'Contents' repository permissions");
2727
return;
2828
}
29-
29+
3030
platform.logger.debug(`GitHub Repository: ${githubRepository}`);
3131
platform.logger.debug(`GitHub Token provided: ${githubToken ? 'Yes' : 'No'}`);
3232

componentDetection.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,31 @@ export default class ComponentDetection {
4444
try {
4545
this.platform.logger.debug(`Downloading latest release for ${process.platform}`);
4646
const downloadURL = await this.getLatestReleaseURL();
47-
47+
4848
if (!downloadURL) {
4949
throw new Error(`No download URL found for platform: ${process.platform}`);
5050
}
51-
51+
5252
this.platform.logger.debug(`Download URL: ${downloadURL}`);
53-
53+
5454
const response = await fetch(new URL(downloadURL));
5555
if (!response.ok) {
5656
throw new Error(`Failed to download component-detection: ${response.status} ${response.statusText}`);
5757
}
58-
58+
5959
const blob = await response.blob();
6060
const arrayBuffer = await blob.arrayBuffer();
6161
const buffer = new Uint8Array(arrayBuffer);
6262

6363
// Write the blob to a file
6464
this.platform.logger.debug(`Writing binary to file ${this.componentDetectionPath}`);
6565
fs.writeFileSync(this.componentDetectionPath, buffer, { mode: 0o777, flag: 'w' });
66-
66+
6767
// Verify the file was created and is executable
6868
if (!fs.existsSync(this.componentDetectionPath)) {
6969
throw new Error(`Failed to create component-detection executable at ${this.componentDetectionPath}`);
7070
}
71-
71+
7272
this.platform.logger.debug(`Successfully downloaded and saved component-detection to ${this.componentDetectionPath}`);
7373
} catch (error: any) {
7474
this.platform.logger.error(`Error downloading component-detection: ${error.message}`);
@@ -104,12 +104,12 @@ export default class ComponentDetection {
104104

105105
try {
106106
await exec.exec(command);
107-
107+
108108
// Verify the output file was created
109109
if (!fs.existsSync(this.outputPath)) {
110110
throw new Error(`Component detection completed but output file ${this.outputPath} was not created`);
111111
}
112-
112+
113113
this.platform.logger.debug(`Component detection completed successfully. Output file: ${this.outputPath}`);
114114
} catch (error: any) {
115115
this.platform.logger.error(`Component detection execution failed: ${error.message}`);
@@ -129,18 +129,18 @@ export default class ComponentDetection {
129129

130130
public static async getManifestsFromResults(): Promise<Manifest[] | undefined> {
131131
this.platform.logger.info("Getting manifests from results");
132-
132+
133133
if (!fs.existsSync(this.outputPath)) {
134134
throw new Error(`Output file ${this.outputPath} does not exist. Component detection may have failed.`);
135135
}
136-
136+
137137
try {
138138
const results = await fs.readFileSync(this.outputPath, 'utf8');
139139
if (!results.trim()) {
140140
this.platform.logger.warning(`Output file ${this.outputPath} is empty`);
141141
return [];
142142
}
143-
143+
144144
var json: any = JSON.parse(results);
145145
let dependencyGraphs: DependencyGraphs = this.normalizeDependencyGraphPaths(json.dependencyGraphs, this.platform.input.getInput('filePath'));
146146
return this.processComponentsToManifests(json.componentsFound, dependencyGraphs);
@@ -347,9 +347,9 @@ export default class ComponentDetection {
347347

348348
// For accessing public repositories, don't use auth if no token is provided
349349
// This prevents "Bad credentials" errors when accessing public repos
350-
const octokitConfig: any = {
351-
baseUrl: githubAPIURL,
352-
request: { fetch: fetch},
350+
const octokitConfig: any = {
351+
baseUrl: githubAPIURL,
352+
request: { fetch: fetch},
353353
log: {
354354
debug: this.platform.logger.debug,
355355
info: this.platform.logger.info,
@@ -374,10 +374,10 @@ export default class ComponentDetection {
374374

375375
var downloadURL: string = "";
376376
const assetName = process.platform === "win32" ? "component-detection-win-x64.exe" : "component-detection-linux-x64";
377-
377+
378378
this.platform.logger.debug(`Looking for asset: ${assetName}`);
379379
this.platform.logger.debug(`Available assets: ${latestRelease.data.assets.map(a => a.name).join(', ')}`);
380-
380+
381381
latestRelease.data.assets.forEach((asset: any) => {
382382
if (asset.name === assetName) {
383383
downloadURL = asset.browser_download_url;

src/providers/azureDevOpsProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ export class AzureDevOpsInputProvider implements IInputProvider {
3434
// ADO task inputs are available as environment variables with INPUT_ prefix
3535
const envName = `INPUT_${name.toUpperCase().replace(/-/g, '_')}`;
3636
const value = process.env[envName] || '';
37-
37+
3838
// Special handling for token input - also check GITHUB_TOKEN for backward compatibility
3939
if (name === 'token' && !value) {
4040
return process.env['GITHUB_TOKEN'] || '';
4141
}
42-
42+
4343
return value;
4444
}
4545

0 commit comments

Comments
 (0)