Scoping an admin link to only show for certain node bundles
I solved this. I mentioned that I had tried hook_local_tasks_alter when I should have been using hook_menu_local_tasks_alter

/**
 * Implements hook_menu_local_tasks_alter().
 * @param $local_tasks
 * @param $route_name
 * @param RefinableCacheableDependencyInterface $cacheability
 */
function mymodule_menu_local_tasks_alter(&amp;$local_tasks, $route_name, RefinableCacheableDependencyInterface &amp;$cacheability)
{
  if ($route_name == 'entity.node.edit_form') {
    $route_match = \Drupal::routeMatch();
    $node = $route_match-&gt;getParameter('node');

    if ('A' != $node-&gt;bundle()) {
      unset($local_tasks['tabs'][0]['my_module.related_B']);
    }
  }
}