Skip to content

Commit 6b2a31d

Browse files
authored
Address comments
1 parent 4a20f6e commit 6b2a31d

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

lib/download-database.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/download-database.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/download-database.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file borrows heavily from the actions "downloadTool" function:
2-
// https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts#L38
2+
// https://github.com/actions/toolkit/blob/27f76dfe1afb2b7e5e679cd8e97192d34d8320e6/packages/tool-cache/src/tool-cache.ts
33

44
import * as fs from "fs";
55
import * as path from "path";
@@ -16,21 +16,19 @@ export class HTTPError extends Error {
1616
httpMessage: string;
1717
constructor(httpStatusCode: number | undefined, httpMessage: string) {
1818
super(`Unexpected HTTP response: ${httpStatusCode}. ${httpMessage}`);
19-
// Set status code and error message to `this`
2019
this.httpStatusCode = httpStatusCode;
2120
this.httpMessage = httpMessage;
2221
}
2322
}
2423

25-
const userAgent = "actions/tool-cache";
24+
const userAgent = "GitHub remote queries";
2625

2726
/**
2827
* Download a database from an url and stream it into a file
2928
*
3029
* @param url url of database to download
3130
* @param dest path to download database
3231
* @param auth authorization header
33-
* @param headers other headers
3432
* @returns path to downloaded database
3533
*/
3634
export async function downloadDatabaseFile(
@@ -48,7 +46,7 @@ export async function downloadDatabaseFile(
4846
const retryHelper = new RetryHelper(maxAttempts, minSeconds, maxSeconds);
4947
return await retryHelper.execute(
5048
async () => {
51-
return await downloadDatabaseFileAttempt(url, dest || "", auth);
49+
return await downloadDatabaseFileAttempt(url, dest, auth);
5250
},
5351
(err: Error) => {
5452
if (err instanceof HTTPError && err.httpStatusCode) {

0 commit comments

Comments
 (0)