Skip to content

github_remote_list() not picking up GHE host #1897

Open

Description

@tsahota

Hi I'm having trouble using usethis::use_github_release() on a GHE host:

> usethis::use_github_release()
Error in `stop_bad_github_remote_config()` at usethis/R/utils-github.R:615:4:
! Unsupported GitHub remote configuration: 'no_github'
• Host = NA
• origin = <not configured>
• upstream = <not configured>
• Neither 'origin' nor 'upstream' is a GitHub repo.

Here is my remote (note no 'github' string is present in the hostname):

> gert::git_remote_list()
# A tibble: 1 × 2
  name   url                                                  
* <chr>  <chr>                                                
1 origin https://ghe-gsk-prod.metworx.com/account/reponame

I believe the source of the issue is in github_remote_list() which contains the lines:

parsed <- parse_github_remotes(set_names(x$url, x$name))
# TODO: generalize here for GHE hosts that don't include 'github'
is_github <- grepl("github", parsed$host)

and since 'github' doesn't match anything in https://ghe-gsk-prod.metworx.com/account/reponame, this causes the issue above. The TODO comment indicates that the author was aware.

This was introduced in commit 43f6d2d and I'd be grateful if this useful function could be made to work on non 'github' matching GHE host names!

Activity

  1. jennybc commented on Sep 22, 2023

    @jennybc
    Member

    Yeah, basically I was waiting to see if anyone actually felt this pain. The simplest thing to do when introducing GHE support was to recognize such a host by looking for "github". I'm not entirely sure what I will do about this, but thanks for opening the issue. It's good to know that someone has banged their shins on this in real life.

    In the meantime, have you considered renaming your GHE instance? 😜

  2. added
    git
    on Sep 22, 2023
  3. tsahota commented on Sep 23, 2023

    @tsahota
    Author

    OK thanks. I've opted to make my own little version without the is_github test. But hopefully there can be an easy solution to this in future, then I can get rid of my hack and... usethis

  4. added
    bug
    on Nov 3, 2023
  5. jennybc commented on Jul 29, 2025

    @jennybc
    Member

    Merging #2098 is a step in the right direction, but it does not solve @tsahota's problem.

    Discussion with @jameslairdsmith in #2098 reveals that there are 2 relevant GitHub Enterprise products:

    • GitHub Enterprise Cloud (which usethis should now play nicely with)
    • GitHub Enterprise Server (which remains unhandled)

    The URLs for GHEC are very predictable and can therefore be handled as slight variations on what we do to recognize and process github.com URLs.

    The URLs for GHES are not predictable and support will require the ability for the user to literally tell us exactly what their GHE hostname is. So this issue remains open.

  6. added this to the Backlog milestone on Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggit

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions