Change site name programmatically
Nearly :

$config = \Drupal::service('config.factory')-&gt;getEditable('system.site');
$config-&gt;set('name', "XXXXXXX"); 
$config-&gt;save();


Just have to implement hook_node_update to fit your needs.