attempt with comparing index

This commit is contained in:
bethanyj28 committed 2024-02-23 11:59:36 -05:00
1 parent b3553fd676
commit d46fe375bc
2 files changed
+9 -7

No files matched your search

+6 -4
View File
@@ -94,10 +94,12 @@ export async function streamExtractExternal(
})
.pipe(unzip.Parse())
.on('entry', (entry: unzip.Entry) => {
const entryPath = path
.normalize(entry.path)
.replace(/^(\.\.(\/|\\|$))+/, '')
const fullPath = path.join(directory, entryPath)
console.log(`entryPath: ${entry.path}`)
const fullPath = path.normalize(path.join(directory, entry.path))
console.log(`fullPath: ${fullPath}`)
if (fullPath.indexOf(directory) != 0) {
reject(new Error(`Invalid file path: ${fullPath}`))
}
core.debug(`Extracting artifact entry: ${fullPath}`)
if (entry.type === 'Directory') {
promises.push(resolveOrCreateDirectory(fullPath).then(() => {}))