File location for new CiviRules Action
You put it in your own extension, under the CRM folder and subfolders you need to create depending on the class name. See https://docs.civicrm.org/civirules/en/latest/create-your-own-action/#step-2-add-a-class-that-extends-crm_civirule_action

You can include the class file in the Civirules extension if you want,
but you can also include it in your own extension. This class should extend
CRM_Civirules_Action to be able to add your action to the CiviRules Engine


So let's say your class is CRM_Mynamespace_CivirulesActions_Contact_Subtype, then you'd call the file Subtype.php and put it in your extension in CRM/Mynamespace/CivirulesActions/Contact