Skip to content

Commit 24ed1a3

Browse files
authored
Check platform for extension (#1732)
1 parent 44c2b7a commit 24ed1a3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,9 @@ function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath,
15741574
// Write archive to disk
15751575
core.info('Writing archive to disk');
15761576
const uniqueId = (0, uuid_1.v4)();
1577-
const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
1577+
const archivePath = IS_WINDOWS
1578+
? path.join(repositoryPath, `${uniqueId}.zip`)
1579+
: path.join(repositoryPath, `${uniqueId}.tar.gz`);
15781580
yield fs.promises.writeFile(archivePath, archiveData);
15791581
archiveData = Buffer.from(''); // Free memory
15801582
// Extract archive

src/github-api-helper.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export async function downloadRepository(
3535
// Write archive to disk
3636
core.info('Writing archive to disk')
3737
const uniqueId = uuid()
38-
const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`)
38+
const archivePath = IS_WINDOWS
39+
? path.join(repositoryPath, `${uniqueId}.zip`)
40+
: path.join(repositoryPath, `${uniqueId}.tar.gz`)
3941
await fs.promises.writeFile(archivePath, archiveData)
4042
archiveData = Buffer.from('') // Free memory
4143

0 commit comments

Comments
 (0)