From 7a2b445a4b9c1818428cec57d8b07aab4fddef95 Mon Sep 17 00:00:00 2001
From: eric sciple <ericsciple@users.noreply.github.com>
Date: Tue, 10 Dec 2019 01:53:49 -0500
Subject: [PATCH] .

---
 dist/index.js            | 1 +
 src/github-api-helper.ts | 1 +
 2 files changed, 2 insertions(+)

diff --git a/dist/index.js b/dist/index.js
index 0ded637..25b27e7 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -8404,6 +8404,7 @@ function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPat
                 yield downloadFile(archiveUrl, fileStream);
             }
             finally {
+                fileStream.end();
                 yield fileStreamClosed;
             }
             // return Buffer.from(response.data) // response.data is ArrayBuffer
diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts
index 764156c..37a467d 100644
--- a/src/github-api-helper.ts
+++ b/src/github-api-helper.ts
@@ -69,6 +69,7 @@ export async function downloadRepository(
       core.info('Downloading the archive') // Do not print the archive URL because it has an embedded token
       await downloadFile(archiveUrl, fileStream)
     } finally {
+      fileStream.end()
       await fileStreamClosed
     }