Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Configurable ACL #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Upload S3 ☁️

This action upload directory to AWS S3 by [public read](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html) and output key that generated by [shortid](https://github.com/dylang/shortid)
This action upload directory to AWS S3 with a specified ACL ([public read](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html) by default) and output key that generated by [shortid](https://github.com/dylang/shortid)

> Note - The last source_dir name(`foo/bar/will-be-replace`) will be replaced to the key generated as shortid.
The reason is that upload a new one every time and I want to access s3 with a new key value. If you want to upload a single file, be sure to **create a folder** and upload it.
Expand All @@ -27,6 +27,7 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: 'dirname'
acl: 'public-read'
```

Recommend using with [deployment-action](https://github.com/marketplace/actions/deployment-action) in pull request.
Expand Down Expand Up @@ -80,6 +81,7 @@ The following settings must be passed as environment variables as shown in the e
| `source_dir` | (Required) The local directory (or file) you wish to upload to S3. The directory will replace to key generated by [shortid](https://github.com/dylang/shortid) in S3 |
| `destination_dir` | (Optional) The destination directory in S3<br />If this field is excluded a [shortid](https://github.com/dylang/shortid) will be generated |
| `endpoint` | (Optional) The endpoint URI to send requests to. [More info here.](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html) |
| `acl` | (Optional) The ACL to apply to the uploaded files. Defaults to "public-read". [More info here.](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) |

> To upload to the root directory, set `destination_dir: ''` in `action.yml`

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ inputs:
endpoint:
required: false
description: 'endpoint URI to send requests'
acl:
required: false
description: 'access control list to apply to uploaded objects'
default: "public-read"
outputs:
object_key:
description: 'object key'
Expand Down
Loading