code: public void unregisterFor(GitHubRepositoryName name, List<GitHubRepositoryName> aliveRepos) {
          try {
              GHRepository repo = checkNotNull(
                      from(name.resolve(allowedToManageHooks())).firstMatch(withAdminAccess()).orNull(),
                      "There are no credentials with admin access to manage hooks on %s", name
              );
  
              LOGGER.debug("Check {} for redundant hooks...", repo);
  
              Predicate<GHHook> predicate = aliveRepos.contains(name)
                      ? serviceWebhookFor(endpoint) // permanently clear service hooks (JENKINS-28138)
                      : or(serviceWebhookFor(endpoint), webhookFor(endpoint));
  
              from(fetchHooks().apply(repo))
                      .filter(predicate)
                      .filter(deleteWebhook())
                      .filter(log("Deleted hook")).toList();
  
          } catch (Throwable t) {
              LOGGER.warn("Failed to remove hook from {}", name, t);
              GitHubHookRegisterProblemMonitor.get().registerProblem(name, t);
          }
      }
docs: Used to cleanup old hooks in case of removed or reconfigured trigger
  since JENKINS-28138 this method permanently removes service hooks
  
  So if the trigger for given name was only reconfigured, this method filters only service hooks
  (with help of aliveRepos names list), otherwise this method removes all hooks for managed url
  
  @param name       repository to clean hooks
  @param aliveRepos repository list which has enabled trigger in jobs