diff --git a/eng/common/testproxy/onboarding/generate-assets-json.ps1 b/eng/common/testproxy/onboarding/generate-assets-json.ps1 index 3576fd3c6bd6..404435471f88 100644 --- a/eng/common/testproxy/onboarding/generate-assets-json.ps1 +++ b/eng/common/testproxy/onboarding/generate-assets-json.ps1 @@ -14,7 +14,7 @@ In that case, the assets.json should live alongside the ci.yml in the sdk/" - this is will be computed from repository it's being run in. +- AssetsRepoPrefixPath: "" - this is will be computed from repository it's being run in. - TagPrefix: "/" or "//" or deeper if things are nested in such a manner. All tags created for this assets.json will start with this name. - Tag: "" - Initially empty, as nothing has yet been pushed. @@ -81,6 +81,7 @@ $LangRecordingDirs = @{"cpp" = "recordings"; . (Join-Path $PSScriptRoot "common-asset-functions.ps1") Test-Exe-In-Path -ExeToLookFor $GitExe + $language = Get-Repo-Language # If the initial push is being performed, ensure that test-proxy is @@ -89,7 +90,7 @@ $language = Get-Repo-Language if ($InitialPush) { $proxyPresent = Test-Exe-In-Path -ExeToLookFor $TestProxyExe -ExitOnError $false - # try to fall back + # try to fall back if (-not $proxyPresent) { $StandaloneTestProxyExe = "Azure.Sdk.Tools.TestProxy" @@ -107,6 +108,17 @@ if ($InitialPush) { Write-Error "The user has selected option InitialPush to push their assets, neither $TestProxyExe nor standalone executable $StandaloneTestProxyExe are installed on this machine." exit 1 } + + # if we're pushing, we also need to confirm that the necessary git configuration items are set + $result = git config --get user.name + if ($LASTEXITCODE -ne 0 -or !$result){ + Write-Error "The git config setting `"user.name`" is unset. Set it to your git user name via 'git config --global user.name `"`'" + } + + $result = git config --get user.email + if ($LASTEXITCODE -ne 0 -or !$result){ + Write-Error "The git config setting `"user.email`" is unset. Set it to your git email via 'git config --global user.email `"`'" + } } if ($TestProxyExe -eq "test-proxy" -or $TestProxyExe.StartsWith("Azure.Sdk.Tools.TestProxy")) {