mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-27 08:58:28 +02:00
ensure we're downloading to the correct directory
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
parent
34aa167be5
commit
c91b9fb13e
2 changed files with 7 additions and 2 deletions
|
@ -41,12 +41,16 @@ async function run(): Promise<void> {
|
|||
continue
|
||||
}
|
||||
const getObjectParams = {Bucket: s3Bucket, Key: fileObject.Key}
|
||||
const localKey = fileObject.Key.replace(s3Prefix, '')
|
||||
const localKey = path.join(
|
||||
resolvedPath,
|
||||
fileObject.Key.replace(s3Prefix, '')
|
||||
)
|
||||
const writeStream = fs.createWriteStream(localKey)
|
||||
core.info(`Started download: ${localKey}`)
|
||||
core.debug(`S3 download uri: s3://${s3Bucket}/${fileObject.Key}`)
|
||||
const readStream = s3.getObject(getObjectParams).createReadStream()
|
||||
readStream.pipe(writeStream)
|
||||
writeStream.close()
|
||||
core.info(`Finished download for ${localKey}`)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue