Hi again, Would like to ask if there would be a function in replication preprocessor that could check/return a value if the current page/resource is being published to Preview or Publish environment?
I think you can try to get the information which agent is used, base on agent Id that can be retrieved from ReplicationAction object. So in preprocessor implementation it should be possible like this:
In general in cloud setup you have agent with publish id that represents publish tier, and preview id for preview publish. Both are mentioned in the official documentation: