Skip to content

Commit

Permalink
Allow env vars (#13)
Browse files Browse the repository at this point in the history
* allow env vars

* manually run prettier

* rebuild dist

* Revert "rebuild dist"

This reverts commit 9d56240.

* rebuild dist using node16
  • Loading branch information
rlukata authored Oct 31, 2023
1 parent d792d9b commit 7d69ef2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 17 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ inputs:
required: true
aws-access-key-id:
description: 'An AWS access key id to access the bucket'
required: true
required: false
aws-secret-access-key:
description: 'An AWS secret access key to access the bucket'
required: true
required: false
aws-region:
description: 'An AWS region where the bucket is located'
required: false
Expand Down
8 changes: 5 additions & 3 deletions dist/restore-only/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15852,10 +15852,12 @@ function getInputS3ClientConfig() {
}
const s3config = {
credentials: {
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId),
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey)
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId) ||
process.env["AWS_ACCESS_KEY_ID"],
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey) ||
process.env["AWS_SECRET_ACCESS_KEY"]
},
region: core.getInput(constants_1.Inputs.AWSRegion),
region: core.getInput(constants_1.Inputs.AWSRegion) || process.env["AWS_REGION"],
endpoint: core.getInput(constants_1.Inputs.AWSEndpoint),
bucketEndpoint: core.getBooleanInput(constants_1.Inputs.AWSS3BucketEndpoint),
forcePathStyle: core.getBooleanInput(constants_1.Inputs.AWSS3ForcePathStyle)
Expand Down
8 changes: 5 additions & 3 deletions dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15852,10 +15852,12 @@ function getInputS3ClientConfig() {
}
const s3config = {
credentials: {
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId),
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey)
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId) ||
process.env["AWS_ACCESS_KEY_ID"],
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey) ||
process.env["AWS_SECRET_ACCESS_KEY"]
},
region: core.getInput(constants_1.Inputs.AWSRegion),
region: core.getInput(constants_1.Inputs.AWSRegion) || process.env["AWS_REGION"],
endpoint: core.getInput(constants_1.Inputs.AWSEndpoint),
bucketEndpoint: core.getBooleanInput(constants_1.Inputs.AWSS3BucketEndpoint),
forcePathStyle: core.getBooleanInput(constants_1.Inputs.AWSS3ForcePathStyle)
Expand Down
8 changes: 5 additions & 3 deletions dist/save-only/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15852,10 +15852,12 @@ function getInputS3ClientConfig() {
}
const s3config = {
credentials: {
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId),
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey)
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId) ||
process.env["AWS_ACCESS_KEY_ID"],
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey) ||
process.env["AWS_SECRET_ACCESS_KEY"]
},
region: core.getInput(constants_1.Inputs.AWSRegion),
region: core.getInput(constants_1.Inputs.AWSRegion) || process.env["AWS_REGION"],
endpoint: core.getInput(constants_1.Inputs.AWSEndpoint),
bucketEndpoint: core.getBooleanInput(constants_1.Inputs.AWSS3BucketEndpoint),
forcePathStyle: core.getBooleanInput(constants_1.Inputs.AWSS3ForcePathStyle)
Expand Down
8 changes: 5 additions & 3 deletions dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15852,10 +15852,12 @@ function getInputS3ClientConfig() {
}
const s3config = {
credentials: {
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId),
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey)
accessKeyId: core.getInput(constants_1.Inputs.AWSAccessKeyId) ||
process.env["AWS_ACCESS_KEY_ID"],
secretAccessKey: core.getInput(constants_1.Inputs.AWSSecretAccessKey) ||
process.env["AWS_SECRET_ACCESS_KEY"]
},
region: core.getInput(constants_1.Inputs.AWSRegion),
region: core.getInput(constants_1.Inputs.AWSRegion) || process.env["AWS_REGION"],
endpoint: core.getInput(constants_1.Inputs.AWSEndpoint),
bucketEndpoint: core.getBooleanInput(constants_1.Inputs.AWSS3BucketEndpoint),
forcePathStyle: core.getBooleanInput(constants_1.Inputs.AWSS3ForcePathStyle)
Expand Down
10 changes: 7 additions & 3 deletions src/utils/actionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,14 @@ export function getInputS3ClientConfig(): S3ClientConfig | undefined {

const s3config = {
credentials: {
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
accessKeyId:
core.getInput(Inputs.AWSAccessKeyId) ||
process.env["AWS_ACCESS_KEY_ID"],
secretAccessKey:
core.getInput(Inputs.AWSSecretAccessKey) ||
process.env["AWS_SECRET_ACCESS_KEY"]
},
region: core.getInput(Inputs.AWSRegion),
region: core.getInput(Inputs.AWSRegion) || process.env["AWS_REGION"],
endpoint: core.getInput(Inputs.AWSEndpoint),
bucketEndpoint: core.getBooleanInput(Inputs.AWSS3BucketEndpoint),
forcePathStyle: core.getBooleanInput(Inputs.AWSS3ForcePathStyle)
Expand Down

0 comments on commit 7d69ef2

Please sign in to comment.