fix regression, auto readlink on symlinks again

This commit is contained in:
Rob Herley
2024-09-20 17:23:43 -04:00
parent 6dd369c0e6
commit 7f19a7886a
7 changed files with 83 additions and 20 deletions
+9 -2
View File
@@ -1,4 +1,5 @@
import * as stream from 'stream'
import {readlink} from 'fs/promises'
import * as archiver from 'archiver'
import * as core from '@actions/core'
import {UploadZipSpecification} from './upload-zip-specification'
@@ -42,8 +43,14 @@ export async function createZipUploadStream(
for (const file of uploadSpecification) {
if (file.sourcePath !== null) {
// Add a normal file to the zip
zip.file(file.sourcePath, {
// Check if symlink and resolve the source path
let sourcePath = file.sourcePath
if (file.stats.isSymbolicLink()) {
sourcePath = await readlink(file.sourcePath)
}
// Add the file to the zip
zip.file(sourcePath, {
name: file.destinationPath
})
} else {