This simple action uses the vanilla AWS CLI to head object in remote S3 bucket.
name: Head Object
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: StreamAMG/s3-head-object-action@master
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_OBJECT_KEY: 'file.json'
AWS_REGION: 'eu-west-1' # optional: defaults to eu-west-1
The following settings must be passed as environment variables as shown in the example. Sensitive information, especially AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
, should be set as encrypted secrets — otherwise, they'll be public to anyone browsing your repository's source code and CI logs.
Key | Value | Suggested Type | Required | Default |
---|---|---|---|---|
AWS_ACCESS_KEY_ID |
Your AWS Access Key. More info here. | secret env |
Yes | N/A |
AWS_SECRET_ACCESS_KEY |
Your AWS Secret Access Key. More info here. | secret env |
Yes | N/A |
AWS_S3_BUCKET |
The name of the bucket you're syncing to. For example, my-app-releases . |
secret env |
Yes | N/A |
AWS_S3_OBJECT_KEY |
The key of the object in bucket you want to run s3api head-object CLI command. For example, file.json or my-app-releases . |
env |
Yes | N/A |
AWS_REGION |
The region where you created your bucket. Set to us-east-1 by default. Full list of regions here. |
env |
No | eu-west-1 |