From 156c181c0f52658fc7905c0aea2ac693a430783a Mon Sep 17 00:00:00 2001
From: Cory Miller <13227161+cory-miller@users.noreply.github.com>
Date: Thu, 9 May 2024 15:37:36 +0000
Subject: [PATCH] Check platform for extension

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

diff --git a/dist/index.js b/dist/index.js
index c39596b..e128adf 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1574,7 +1574,9 @@ function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath,
         // Write archive to disk
         core.info('Writing archive to disk');
         const uniqueId = (0, uuid_1.v4)();
-        const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
+        const archivePath = IS_WINDOWS
+            ? path.join(repositoryPath, `${uniqueId}.zip`)
+            : path.join(repositoryPath, `${uniqueId}.tar.gz`);
         yield fs.promises.writeFile(archivePath, archiveData);
         archiveData = Buffer.from(''); // Free memory
         // Extract archive
diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts
index 8eb65d1..1ff27c2 100644
--- a/src/github-api-helper.ts
+++ b/src/github-api-helper.ts
@@ -35,7 +35,9 @@ export async function downloadRepository(
   // Write archive to disk
   core.info('Writing archive to disk')
   const uniqueId = uuid()
-  const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`)
+  const archivePath = IS_WINDOWS
+    ? path.join(repositoryPath, `${uniqueId}.zip`)
+    : path.join(repositoryPath, `${uniqueId}.tar.gz`)
   await fs.promises.writeFile(archivePath, archiveData)
   archiveData = Buffer.from('') // Free memory