Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
feature: straight up params names
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexShemeshWix committed Oct 12, 2020
1 parent 42acbbc commit cd602cb
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ In order to use this action you need bucket in aws s3 and proper credentials for
```yaml
uses: wixplosives/action-upload-to-s3@v1
with:
aws_secret_id: YOU_AWS_SECRET_ID
aws_secret_key: YOU_AWS_SECRET_KEY
aws_bucket: test-bucket
aws_subfolder: test-folder
folder_to_upload: my-folder
accessKeyId: YOUR_AWS_SECRET_ID
secretAccessKey: YOUR_AWS_SECRET_KEY
awsBucket: test-bucket
s3Subfolder: test-folder
sourceFolder: my-folder
```
## Usage:
Expand Down
22 changes: 11 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ description: 'Recursively upload folder to S3 bucket'
author: 'core3'
branding:
icon: 'crosshair'
color: 'blue'
color: 'green'
inputs:
aws_secret_id: # change this
accessKeyId:
required: true
description: 'input description here'
aws_secret_key: # change this
description: 'AWS Access key id (short one)'
secretAccessKey:
required: true
description: 'input description here'
aws_bucket:
description: 'AWS Secret access key (long one)'
awsBucket:
required: true
description: 'input description here'
aws_subfolder:
description: 'bucket name'
s3Subfolder:
required: true
description: 'input description here'
folder_to_upload:
description: 'subfolder in bucket to upload data to'
sourceFolder:
required: true
description: 'input description here'
description: 'sourcefolder to upload'
runs:
using: 'node12'
main: 'dist/index.js'
22 changes: 11 additions & 11 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ async function internalUploadFolder(
}
}

export async function uploadFolder(accessKey: string, accessSecretID: string, awsBucket:string , awsSubfolder: string, folderPath: string) {
const folderStats = fs.statSync(folderPath);
export async function uploadFolder(accessKeyId: string, secretAccessKey: string, awsBucket:string , s3Subfolder: string, sourceFolder: string) {
const folderStats = fs.statSync(sourceFolder);
if (!folderStats.isDirectory()) {
throw new Error(`${folderPath} is not a directory.`);
throw new Error(`${sourceFolder} is not a directory.`);
}
return await internalUploadFolder(accessKey, accessSecretID, awsBucket, awsSubfolder, folderPath);
return await internalUploadFolder(accessKeyId, secretAccessKey, awsBucket, s3Subfolder, sourceFolder);
}
14 changes: 7 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {uploadFolder} from './aws'

async function run(): Promise<void> {
try {
const awsSecretId: string = core.getInput('aws_secret_id')
const awsSecretKey: string = core.getInput('aws_secret_key')
const awsBucket: string = core.getInput('aws_bucket')
const awsSubfolder: string = core.getInput('aws_subfolder')
const folderToUpload: string = core.getInput('folder_to_upload')
core.info(`Uploaing ${folderToUpload} to ${awsBucket}/${awsSubfolder}`)
await uploadFolder(awsSecretKey, awsSecretId, awsBucket , awsSubfolder, folderToUpload)
const accessKeyId: string = core.getInput('accessKeyId')
const secretAccessKey: string = core.getInput('secretAccessKey')
const awsBucket: string = core.getInput('awsBucket')
const s3Subfolder: string = core.getInput('s3Subfolder')
const sourceFolder: string = core.getInput('sourceFolder')
core.info(`Uploaing ${sourceFolder} to ${awsBucket}/${s3Subfolder}`)
await uploadFolder(accessKeyId, secretAccessKey, awsBucket , s3Subfolder, sourceFolder)
core.info('Done')
} catch (error) {
core.setFailed(error.message)
Expand Down

0 comments on commit cd602cb

Please sign in to comment.