I am not sure if this would be considered a bug, but I encountered a difficulty when trying to have a single action trigger with "on earn" for a building... with subsequent purchases of the building, the "on earn" is triggering with not only the most recent purchase, but all of the previous purchases...
so a line like: on earn:yield 1 thing
would yield 1, then 2, then 3, etc. things.
This seems to be the same for on click also.
I thought I could restrict the command by having "on earn" yield a building with a limit of 1 but that still overrode the limit (triggering the "on earn" within the building in excess of the limit) - I thought I could put a conditional if statement, reducing the building to 0 and only triggering when the building was back to 0, but again this failed.
The only workaround I have found is to use a hidden upgrade instead of a building - as these are hardcoded to a singular purchase, it only triggers from the "on earn" once even if the upgrade has been yielded multiple times from an "on earn" in a building.
I hope the knowledge of this workaround may be useful to someone who wants to have a building cost a set value of a particular resource without increasing in value.