diff --git a/dist/index.js b/dist/index.js index 6e44887..d6b53bc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8373,7 +8373,7 @@ function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPat const archivePath = path.join(runnerTemp, 'checkout.tar.gz'); // await fs.promises.writeFile(archivePath, raw) // Get the archive URL using the REST API - let archiveUrl = retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () { + yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () { // Prepare the archive stream core.debug(`Preparing the archive stream: ${archivePath}`); yield io.rmRF(archivePath); @@ -8464,16 +8464,16 @@ function downloadFile(url, fileStream) { response.resume(); // Consume response data to free up memory return; } - // response.on('data', chunk => { - // fileStream.write(chunk) - // }) + response.on('data', chunk => { + fileStream.write(chunk); + }); response.on('end', () => { resolve(); }); response.on('error', err => { reject(err); }); - response.pipe(fileStream); + // response.pipe(fileStream) }); } catch (err) { diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts index b20d863..e0f0cdc 100644 --- a/src/github-api-helper.ts +++ b/src/github-api-helper.ts @@ -32,7 +32,7 @@ export async function downloadRepository( // await fs.promises.writeFile(archivePath, raw) // Get the archive URL using the REST API - let archiveUrl = retryHelper.execute(async () => { + await retryHelper.execute(async () => { // Prepare the archive stream core.debug(`Preparing the archive stream: ${archivePath}`) await io.rmRF(archivePath) @@ -142,16 +142,16 @@ function downloadFile(url: string, fileStream: WriteStream): Promise { return } - // response.on('data', chunk => { - // fileStream.write(chunk) - // }) + response.on('data', chunk => { + fileStream.write(chunk) + }) response.on('end', () => { resolve() }) response.on('error', err => { reject(err) }) - response.pipe(fileStream) + // response.pipe(fileStream) }) } catch (err) { reject(err)