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

Upload only changed files #12

Open
guicaulada opened this issue Dec 11, 2019 · 5 comments
Open

Upload only changed files #12

guicaulada opened this issue Dec 11, 2019 · 5 comments

Comments

@guicaulada
Copy link

Hello, I don't really have an issue, its more like a request, would it be possible to make it only upload the changed files ? I have a big repository and its reuploading every file.

If its not possible that's okay too, this is already very helpful, good job!

@adrianschmidt
Copy link

I have the same issue with this action, but not when I sync folders locally. I wonder if it might have something to do with the temporary environment that GitHub Actions run in, and it causing aws to incorrectly identify all files as modified…?

@chrissingh
Copy link

Found a working solution from another thread. Add '--size-only' without quotes to your args parameter.
aws/aws-cli#5216

@adrianschmidt
Copy link

adrianschmidt commented Sep 1, 2020

@chrissingh Yes! That worked for us. You just helped me cut the running time of our sync-job from 35 minutes (nominal, 90 minutes worst case) to 3.5 minutes. Where do I send the beer?

vorotech added a commit to trustwallet/assets that referenced this issue Oct 15, 2021
sync decides what to sync based on the file's timestamp and size, adding `--size-only` will tell 
sync to ignore timestamps and update files only if their contents changed

Ref jakejarvis/s3-sync-action#12
@adamhathcock
Copy link

I have this issue and also that people change files but have same byte count frequently enough to be an issue.

Unfortunately, there has to be custom code because this use the cli aws s3 sync behind the scenes (https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/sync.html) and what we really need is a hash comparison.

Details here: https://stackoverflow.com/questions/75555482/how-to-use-aws-s3-sync-to-sync-modified-files-that-still-have-the-same-size

@greg-seesaw
Copy link

If you are using this action when merging a branch to main, one idea is to call git diff --raw HEAD^ HEAD to get a list of the affected files in the merge, then construct an --include statement for the s3 sync based on that.

A PR would be out-of-scope for this project though, which is really meant for the broader use case of syncing directories to S3 whenever the action is run. But it would be a nice fork IMHO. I don't see any kind of "S3 Sync upon Merge" action in the Marketplace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants