This will automatically make Files visible to community users, but only specific filenames - and, in turn, hide previous (specific) Files uploaded to the same record.
Developed for Sign Video project. Intended to ensure that Invoices are automatically made visible to customers, but previous versions of that invoice are automatically hidden.
Based on this: git clone https://github.com/douglascayers/sfdx-handle-file-shared-to-record-flow.git