gruntwork-io / fetch

Download files, folders, and release assets from a specific git commit, branch, or tag of public and private GitHub repos.
https://www.gruntwork.io/
MIT License
589 stars 90 forks source link

fetch doesn't work with "SUB" domain in repo URL #28

Closed girishkg closed 2 years ago

girishkg commented 6 years ago

fetch is not working if there are any subdomain in the "--repo" option fetch --repo="https://example.github.com/foo/bar" --tag="0.1.5" --release-asset="foo.exe" /tmp

The error is:

[root@jenkins01 ~]# fetch --repo="https://example.github.com/foo/bar" --tag="0.1.5" --release-asset="foo.exe" /tmp
ERROR: Error occurred while getting tags from GitHub repo: -1 - 300 - GitHub Repo URL https://example.github.com/foo/bar could not be parsed correctly

"example" SUB domain is used here for demonstration purpose.

girishkg commented 6 years ago

Need to change line "102" on "github.go" file regex, regexErr := regexp.Compile("https?://(?:www\\.)?github.com/(.+?)/(.+?)(?:$|\\?|#|/)")

girishkg commented 6 years ago

Not able to re-open : https://github.com/gruntwork-io/fetch/issues/14 So cloning same issue

girishkg commented 6 years ago

Example subdomains are: https://help.github.com/articles/ https://gist.github.com/discover

brikis98 commented 6 years ago

Example subdomains are: https://help.github.com/articles/ https://gist.github.com/discover

Are you using fetch to download something from these domains?

saaguero commented 6 years ago

I want to use fetch for our company's github, which is hosted in a subdomain like:

https://github-stb.company.internalzone.com/

Please consider fixing this issue.

brikis98 commented 6 years ago

Ah, got it. Thanks for the use case!

I agree that's worth fixing. PRs welcome :)

tonerdo commented 2 years ago

Attempted to repro and subdomains seem to work just fine. This issue has been open for quite some time, so I'm closing. Feel free to reopen if it resurfaces.