{"id":16293548,"url":"https://github.com/badsyntax/github-action-aws-s3","last_synced_at":"2025-07-24T06:32:55.626Z","repository":{"id":36987439,"uuid":"437307974","full_name":"badsyntax/github-action-aws-s3","owner":"badsyntax","description":"GitHub Action to sync files to S3. Includes accurate ETAG comparisons and parallel uploads with configurable concurrency \u0026 multipart chunk sizes","archived":false,"fork":false,"pushed_at":"2024-08-28T00:51:37.000Z","size":5329,"stargazers_count":5,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T08:04:03.547Z","etag":null,"topics":["aws","aws-s3","github-action","github-actions","s3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badsyntax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-11T14:44:21.000Z","updated_at":"2024-06-19T10:29:06.000Z","dependencies_parsed_at":"2024-05-30T10:11:55.486Z","dependency_job_id":"26797a06-df54-4ee1-8ddf-c7271829943b","html_url":"https://github.com/badsyntax/github-action-aws-s3","commit_stats":{"total_commits":117,"total_committers":2,"mean_commits":58.5,"dds":0.3931623931623932,"last_synced_commit":"a44b04aad7f67754a07922a92b48c18b8f9d9e3c"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Fgithub-action-aws-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badsyntax","download_url":"https://codeload.github.com/badsyntax/github-action-aws-s3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244543767,"owners_count":20469561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-s3","github-action","github-actions","s3"],"created_at":"2024-10-10T20:11:42.397Z","updated_at":"2025-03-20T03:31:06.299Z","avatar_url":"https://github.com/badsyntax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS S3 GitHub Action\n\n[![Build, Test \u0026 Deploy](https://github.com/badsyntax/github-action-aws-s3/actions/workflows/build-test-deploy.yml/badge.svg?branch=master)](https://github.com/badsyntax/github-action-aws-s3/actions/workflows/build-test-deploy.yml)\n[![CodeQL](https://github.com/badsyntax/github-action-aws-s3/actions/workflows/codeql-analysis.yml/badge.svg?branch=master)](https://github.com/badsyntax/github-action-aws-s3/actions/workflows/codeql-analysis.yml)\n\nA GitHub Action to sync files to S3.\n\n## Features\n\n- Configurable sync strategy (with accurate ETAG comparisons, even for multipart uploads)\n- Parallel uploads with configurable concurrency \u0026 multipart chunk sizes\n- Bucket prefixes\n- Clean an object path (remove a \"directory\")\n- Custom Cache-Control headers\n- Glob path patterns\n- Custom ACL\n- Automatic Content-Type detection\n- Strip extension from filename\n\n## Getting Started\n\nPlease read: \u003chttps://github.com/aws-actions/configure-aws-credentials#credentials\u003e\n\n```yml\nname: 'Sync S3'\n\nconcurrency:\n  group: prod_deploy\n  cancel-in-progress: false\n\non:\n  repository_dispatch:\n  workflow_dispatch:\n  push:\n    branches:\n      - main\n\njobs:\n  deploy:\n    name: 'Sync'\n    runs-on: ubuntu-20.04\n    steps:\n      - uses: actions/checkout@v2\n\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws-region: us-east-1\n\n      - uses: badsyntax/github-action-aws-s3@v1\n        name: Sync HTML files to S3\n        id: sync-html-s3\n        with:\n          bucket: 'my-bucket-us-east-1'\n          aws-region: 'us-east-1'\n          action: 'sync' # sync|clean\n          src-dir: './out' # required only if action is sync\n          files-glob: '**/*.html' # required only if action is sync\n          prefix: 'preview'\n          sync-strategy: |\n            ETag\n            Content-Type\n            Cache-Control\n          strip-extension-glob: '**/**.html'\n          cache-control: 'public,max-age=0,s-maxage=31536000,must-revalidate'\n\n      - name: Output Synced Files\n        run: |\n          echo \"Synced object keys: $S3SyncedFiles\"\n        env:\n          # Use outputs from previous sync steps\n          S3SyncedFiles: ${{ steps.sync-html-s3.outputs.modified-keys }}\n```\n\n## Action Inputs\n\n| Name                                | Description                                                                                                                                                                                                                      | Example                                       |\n| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |\n| `bucket`                            | The name of the S3 bucket                                                                                                                                                                                                        | `example-bucket-us-east-1`                    |\n| `aws-region`                        | The AWS region                                                                                                                                                                                                                   | `us-east-1`                                   |\n| `action`                            | The action to perform. Accepted values: `sync` or `clean`                                                                                                                                                                        | `sync`                                        |\n| `src-dir`                           | Source directory of local files to sync (if using the sync action)                                                                                                                                                               | `./src`                                       |\n| `files-glob`                        | Glob pattern for source files to sync to S3 (if using the sync action)                                                                                                                                                           | `**/*.html`                                   |\n| `prefix` (optional)                 | The prefix for the uploaded object                                                                                                                                                                                               | `custom/folder`                               |\n| `cache-control`                     | Cache-control header                                                                                                                                                                                                             | `public,max-age=31536000,immutable`           |\n| `sync-strategy` (optional)          | A newline-separated list of criteria to define the sync strategy. Criteria values: `ETag`, `ContentType`, `CacheControl`, `LastModified`, `ContentLength`.\u003cbr/\u003e**PLEASE NOTE** `ETag` cannot be used if your bucket is encrypted | `ETag`\u003cbr/\u003e`Content-Type`\u003cbr/\u003e`Cache-Control` |\n| `strip-extension-glob` (optional)   | Glob pattern to strip extension (if using the sync action)                                                                                                                                                                       | `**/**.html`                                  |\n| `acl` (optional)                    | Access control list (options: `authenticated-read, aws-exec-read, bucket-owner-full-control, bucket-owner-read, private, public-read, public-read-write`)                                                                        | `private`                                     |\n| `multipart-file-size-mb` (optional) | The minimum file size, in megabytes, for which to upload files using multipart. The default is `100`                                                                                                                             | `100`                                         |\n| `multipart-chunk-bytes` (optional)  | The chunk size, in bytes, to upload multipart file parts in. The default is `10485760` (10MB)                                                                                                                                    | `10485760`                                    |\n| `concurrency` (optional)            | How many processes to perform at once. The default is `6`                                                                                                                                                                        | `6`                                           |\n\n## Action Outputs\n\n| Name            | Description                                                               | Example                   |\n| --------------- | ------------------------------------------------------------------------- | ------------------------- |\n| `modified-keys` | A comma separated list of modified object keys (either synced or removed) | `file1,folder1/file2.ext` |\n\n## Debugging\n\nCheck the Action output for logs.\n\nIf you need to see more verbose logs you can set `ACTIONS_STEP_DEBUG` to `true` as an Action Secret.\n\n## Motivation\n\nThe [`aws s3 sync`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/sync.html) cli command syncs files based on modified times or file size, but this approach is not appropriate in situations where build hashes might change but file size is unchanged. This action provides a flexible and configuration sync strategy, as well as additional features like stripping file extensions and cleaning a bucket path.\n\n## Related Projects\n\n- [badsyntax/s3-etag](https://github.com/badsyntax/s3-etag)\n- [badsyntax/github-action-aws-cloudfront](https://github.com/badsyntax/github-action-aws-cloudfront)\n- [badsyntax/github-action-aws-cloudformation](https://github.com/badsyntax/github-action-aws-cloudformation)\n- [badsyntax/github-action-issue-comment](https://github.com/badsyntax/github-action-issue-comment)\n- [badsyntax/github-action-render-template](https://github.com/badsyntax/github-action-render-template)\n\n## License\n\nSee [LICENSE.md](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadsyntax%2Fgithub-action-aws-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadsyntax%2Fgithub-action-aws-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadsyntax%2Fgithub-action-aws-s3/lists"}