We are using a CI/CD pipeline to sync the files stored in a Git repo to an S3 bucket. aws s3 sync determines what files should be copied based on their file sizes and last modified timestamps.
However, every time when the Git repo is checked out in the pipeline, each file will get a new timestamp. This causes aws s3 sync to copy files that are probably unchanged to the S3 bucket again.
Another alternative is to run aws s3 sync with the --size-only option. The issue is this command will not be able to sync modified files that still have the same size as before.
Is it possible to use aws s3 sync or any alternative to sync modified files that are based on content changes only?