...
The action can be set to fail if the variable is already defined (note that variables Variables defined during the build are persistent, so if you save a project file after defining a new variable, the new variable will remained defined in the Variables window.)
...