From 81125ebdc96894271afbf1ee5e085d590aea69a3 Mon Sep 17 00:00:00 2001 From: Howard Wolosky Date: Thu, 7 Feb 2019 10:46:55 -0800 Subject: [PATCH] Update Split-GitHubUri to work with the `api.github.com` URI's as well These can be seen when running `Get-GitHubIssue` and looking at: * `url` * `repository_url` * `labels_url` * `comments_url` * `events_url` --- GitHubCore.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GitHubCore.ps1 b/GitHubCore.ps1 index f1db8048..36d5c117 100644 --- a/GitHubCore.ps1 +++ b/GitHubCore.ps1 @@ -735,7 +735,8 @@ function Split-GitHubUri repositoryName = [String]::Empty } - if ($Uri -match '^https?://(?:www.)?github.com/([^/]+)/?([^/]+)?(?:/.*)?$') + if (($Uri -match '^https?://(?:www.)?github.com/([^/]+)/?([^/]+)?(?:/.*)?$') -or + ($Uri -match '^https?://api.github.com/repos/([^/]+)/?([^/]+)?(?:/.*)?$')) { $components.ownerName = $Matches[1] if ($Matches.Count -gt 2)