The action of a free relativistic classical field theory can be derived from Poincare invariance, locality, and retaining terms quadratic in fields. Is there a similar set of symmetry principles which enable one to write down the Einstein-Hilbert (EH) action $$S_{EH}=\frac{c^4}{16\pi G}\int d^4x \sqrt{-g}R\tag{1}$$ uniquely?
In chapter VII.1, of the QFT book by A. Zee, it is mentioned that
The Einstein-Hilbert action is uniquely determined if we require the action to be coordinate invariant and to involve two powers of spacetime derivative.
which is then justified a posteriori. But how does one arrive at the form (1) from scratch and in a neat step-by-step manner?