Skip to content

Failure to use remote info in repo cloned from GitHub Enterprise. #91

@hartzell

Description

@hartzell

Running Jekyll on a GitHub Pages compatible site (e.g. documentation-theme-jekyll) fails with this error message ** even when there is an origin remote defined **.

             Error: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.
$ git remote -v
origin	git@<elided>.com:<elided>/computing-portal.git (fetch)
origin	git@<elided>.com:<elided>/computing-portal.git (push)

This happens because around line 103 of metadata_drop.rb this snippet of code tries to match the "url" (it's not a URL, but that's another issue...) against a pattern that's hardwired for the public github.

matches = git_remote_url.chomp(".git").match %r!github.com(:|/)([\w-]+)/([\w\.-]+)!

One fix would be to use a library like git-remote-parser and combine it's owner and repo attributes.

If there's an objection pulling in the entire gem, one could either borrow bits (in a way that honor'ed its MIT license) or reimplement them.

Can someone comment on the following?

  • Is there any effort to make this gem more useful GitHub Enterprise customers (in which case this issue could tag along on that effort)?

  • Would a PR with a fix that used git-remote-parser be acceptable?

  • Failing the above, what constraints are there on coding up a fix?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions