Skip to content

Commit 3db1d07

Browse files
author
galaydaroman
authored
Fix: Github ssh remote with non git user name (#52)
**Issue:** One of commercial projects on github uses remote origin url of the next format: `org-123456678@github.com:testcompany/testproject.git` Githubinator extension is failing with error `Could not find provider for repo` **Fix:** Change Github matcher to support any user name.
1 parent 0b0082f commit 3db1d07

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## 1.1.1 - 2021-10-12
11+
12+
### Fixed
13+
14+
- support Github ssh remote with non `git` username. Thanks @galaydaroman! (#52)
15+
1016
## 1.1.0 - 2021-06-24
1117

1218
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "githubinator",
33
"displayName": "Githubinator",
44
"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.",
5-
"version": "1.1.0",
5+
"version": "1.1.1",
66
"publisher": "chdsbd",
77
"license": "SEE LICENSE IN LICENSE",
88
"icon": "images/logo256.png",

src/providers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class Github extends BaseProvider {
113113
DEFAULT_HOSTNAMES = ["github.com"]
114114
PROVIDER_NAME = "github"
115115
MATCHERS = [
116-
(hostname: string) => RegExp(`^git@${hostname}:(.*)\/(.*)(\.git)?$`),
116+
(hostname: string) => RegExp(`^[\\w-_]+@${hostname}:(.*)\/(.*)(\.git)?$`),
117117
(hostname: string) => RegExp(`^https:\/\/${hostname}\/(.*)\/(.*)(\.git)?$`),
118118
]
119119
async getUrls({

src/test/suite/providers.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ suite("Github", async () => {
3939
for (let url of [
4040
"git@github.com:recipeyak/recipeyak.git",
4141
"git@github.com:recipeyak/recipeyak",
42+
"org-XYZ123@github.com:recipeyak/recipeyak"
4243
]) {
4344
async function findRemote(hostname: string) {
4445
return url
@@ -69,6 +70,7 @@ suite("Github", async () => {
6970
for (let url of [
7071
"git@github.mycompany.com:recipeyak/recipeyak.git",
7172
"git@github.mycompany.com:recipeyak/recipeyak",
73+
"org-XYZ123@github.mycompany.com:recipeyak/recipeyak"
7274
]) {
7375
async function findRemote(hostname: string) {
7476
return url

0 commit comments

Comments
 (0)