The third time, a script does it
I have one rule for automation, and it is a counter, not a philosophy. Do it once by hand: fine. Twice: annoying, still fine. The third time, a script is already doing it, because by the third repetition I know the task's real shape, its edge cases, and whether it deserves to exist at all.
Automating on the first repetition is how you end up maintaining scripts for tasks that never came back. Waiting past the third is how you become the script. The counter also decides how much to invest: a third-time task gets a shell one-liner, a weekly task gets error handling, a daily task gets logging and a place in the scheduler.
Most of my projects started as this counter hitting three. The mail radar, the deploy scripts, the content pipeline, both open source tools. None of them began as an idea for a product. They began as the third repetition of something I was tired of doing.