Sync eng/common directory with azure-sdk-tools for PR 5427 (#4356)

Co-authored-by: archerzz <archerzz@gmail.com>
This commit is contained in:
Azure SDK Bot 2023-02-13 18:54:18 -08:00 committed by GitHub
parent 326ec44db8
commit 466c82a361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,10 +44,10 @@ function GetGitRemoteValue([string]$repo) {
$gitRemotes = (git remote -v)
foreach ($remote in $gitRemotes) {
if ($remote.StartsWith("origin")) {
if ($remote -match 'https://github.com/\S+[\.git]') {
if ($remote -match 'https://github.com/\S+') {
$result = "https://github.com/$repo.git"
break
} elseif ($remote -match "git@github.com:\S+[\.git]"){
} elseif ($remote -match "git@github.com:\S+"){
$result = "git@github.com:$repo.git"
break
} else {