ensure we're downloading to the correct directory

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
Eli Uriegas 2021-05-19 11:44:26 -07:00
parent 34aa167be5
commit c91b9fb13e
2 changed files with 7 additions and 2 deletions

3
dist/index.js vendored
View file

@ -31184,12 +31184,13 @@ function run() {
continue;
}
const getObjectParams = { Bucket: s3Bucket, Key: fileObject.Key };
const localKey = fileObject.Key.replace(s3Prefix, '');
const localKey = path_1.default.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}`);
}
});