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
44import * as fs from "fs" ;
55import * 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 */
3634export 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