As is well known, in order for the Einstein--Hilbert action to have a well
defined variation, and therefore to be used for deriving field equation through
the stationary action principle, it has to be amended by the addition of a
suitable boundary term. It has recently been claimed that, if one constructs an
action by adding this term to the matter action, the Einstein field equations
can be derived by requiring this action to be invariant under active
transformations which are normal to a null boundary. In this paper we
re-examine this approach both for the case of pure gravity and in the presence
of matter. We show that in the first case this procedure holds for more general
actions than the Einstein-Hilbert one and trace the basis of this remarkable
attribute. However, it is also pointed out the when matter is rigorously
considered the approach breaks down. The reasons for that are thoroughly
discussed.Comment: Typos corrected, minor changes to match published versio