File deletion on reinstall

When you reinstall a suite in cylc 8, it deletes files that aren’t part of the workflow source, or created by cylc.

My use case is that in my install task (first thing to run) I want to install a script from a separate repository into the bin directory of the workflow, so that it is available to all tasks. However, when I reinstall the workflow, this will be deleted.
Copying the script into my workflow source is not appropriate, because it should only have one original repository location.

What is the right way to manage this use case?

The best way to avoid this is to install your files into one of the default Cylc directories e.g. the share directory which is intended for resources which are shared between tasks in the workflow. These directories are excluded from reinstallation so resources placed in them will not be deleted.

Otherwise if you want to keep the files outside of these directories you can list them in a .cylcignore file which will exclude them from reinstallation.

https://cylc.github.io/cylc-doc/stable/html/user-guide/installing-workflows.html#excluding-items-from-installation