This function should do the trick:
/**
* Find all rules with action name matching a string pattern
*
* @param $pattern
* String pattern to check action names
*
* @param $active
* Boolean whether to limit the search to active rules only
*
* @return
* Array with rule names with actions matching the pattern as keys and arrays of rule
* action names as values
*/
function search_rules_for_action($pattern, $active_only = TRUE) {
$active_only = ($active_only) ? array('active' => 1) : array();
$rules = rules_config_load_multiple(FALSE, $active_only);
$matching_rules = array();
foreach ($rules AS $rule_name => $rule) {
if (method_exists($rule, 'actions') === TRUE) {
foreach ($rule->actions() as $action) {
if (method_exists($action, 'getElementName') == TRUE) {
$action_name = $action->getElementName();
if (stripos($action_name, $pattern) !== FALSE) {
$matching_rules[$rule_name][] = $action_name;
}
}
}
}
}
return $matching_rules;
}