ensure defaults for configuration values

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
Eli Uriegas 2021-05-19 11:06:16 -07:00
parent 10ec34d92d
commit 59bb9ed754
4 changed files with 23 additions and 34 deletions

View file

@ -1,7 +1,8 @@
export enum Inputs {
Name = 'name',
Path = 'path',
S3Bucket = 's3-bucket'
S3Bucket = 's3-bucket',
Region = 'region'
}
export enum Outputs {
DownloadPath = 'download-path'

View file

@ -11,6 +11,7 @@ async function run(): Promise<void> {
const name = core.getInput(Inputs.Name, {required: false})
const chosenPath = core.getInput(Inputs.Path, {required: false})
const s3Bucket = core.getInput(Inputs.S3Bucket, {required: false})
const region = core.getInput(Inputs.Region, {required: false})
let resolvedPath = ''
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
@ -21,7 +22,7 @@ async function run(): Promise<void> {
resolvedPath = path.resolve(chosenPath)
}
core.debug(`Resolved path is ${resolvedPath}`)
const s3 = new AWS.S3()
const s3 = new AWS.S3({region: region})
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${name}`
const s3Params = {
Bucket: s3Bucket,