diff --git a/CHANGELOG.md b/CHANGELOG.md index 35c5c7b..b94e823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## 1.1.1 - 2021-10-12 + +### Fixed + +- support Github ssh remote with non `git` username. Thanks @galaydaroman! (#52) + ## 1.1.0 - 2021-06-24 ### Added diff --git a/package.json b/package.json index 71608df..583b115 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "githubinator", "displayName": "Githubinator", "description": "Quickly open files on Github and other providers. View blame information, copy permalinks and more. See the \"commands\" section of the README for more details.", - "version": "1.1.0", + "version": "1.1.1", "publisher": "chdsbd", "license": "SEE LICENSE IN LICENSE", "icon": "images/logo256.png", diff --git a/src/providers.ts b/src/providers.ts index b762a3f..5fc201b 100644 --- a/src/providers.ts +++ b/src/providers.ts @@ -113,7 +113,7 @@ export class Github extends BaseProvider { DEFAULT_HOSTNAMES = ["github.com"] PROVIDER_NAME = "github" MATCHERS = [ - (hostname: string) => RegExp(`^git@${hostname}:(.*)\/(.*)(\.git)?$`), + (hostname: string) => RegExp(`^[\\w-_]+@${hostname}:(.*)\/(.*)(\.git)?$`), (hostname: string) => RegExp(`^https:\/\/${hostname}\/(.*)\/(.*)(\.git)?$`), ] async getUrls({ diff --git a/src/test/suite/providers.test.ts b/src/test/suite/providers.test.ts index 94b5e08..fa61ae5 100644 --- a/src/test/suite/providers.test.ts +++ b/src/test/suite/providers.test.ts @@ -39,6 +39,7 @@ suite("Github", async () => { for (let url of [ "git@github.com:recipeyak/recipeyak.git", "git@github.com:recipeyak/recipeyak", + "org-XYZ123@github.com:recipeyak/recipeyak" ]) { async function findRemote(hostname: string) { return url @@ -69,6 +70,7 @@ suite("Github", async () => { for (let url of [ "git@github.mycompany.com:recipeyak/recipeyak.git", "git@github.mycompany.com:recipeyak/recipeyak", + "org-XYZ123@github.mycompany.com:recipeyak/recipeyak" ]) { async function findRemote(hostname: string) { return url