refactor: share github remote parsing (#843)

This commit is contained in:
Mohamed Boudra
2026-05-09 22:40:05 +08:00
committed by GitHub
parent 0079f2a875
commit f17fb77013
4 changed files with 101 additions and 118 deletions
+2
View File
@@ -5,8 +5,10 @@ describe("parseGitHubRepoFromRemote", () => {
it.each([
["https://github.com/acme/repo.git", "acme/repo"],
["https://github.com/acme/repo", "acme/repo"],
["http://github.com/acme/repo.git", "acme/repo"],
["git@github.com:acme/repo.git", "acme/repo"],
["ssh://git@github.com/acme/repo.git", "acme/repo"],
["ssh://git@ssh.github.com/acme/repo.git", "acme/repo"],
["https://github.com/acme/repo/", "acme/repo"],
])("extracts the repo from %s", (remoteUrl, expected) => {
expect(parseGitHubRepoFromRemote(remoteUrl)).toBe(expected);