Sync eng/common directory with azure-sdk-tools for PR 2348 (#3144)

This commit is contained in:
Azure SDK Bot 2021-11-29 16:41:23 -08:00 committed by GitHub
parent f0a743e02b
commit 38e42875a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
param (
[string]$TargetDirectory = "", # Code path to code owners. e.g sdk/core/azure-amqp
[string]$CodeOwnerFileLocation = (Resolve-Path $PSScriptRoot/../../../.github/CODEOWNERS), # The absolute path of CODEOWNERS file.
[string]$ToolVersion = "1.0.0-dev.20211123.13", # Placeholder. Will update in next PR
[string]$ToolVersion = "1.0.0-dev.20211129.6", # Placeholder. Will update in next PR
[string]$ToolPath = (Join-Path ([System.IO.Path]::GetTempPath()) "codeowners-tool-path"), # The place to check the tool existence. Put temp path as default
[string]$DevOpsFeed = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json", # DevOp tool feeds.
[string]$VsoVariable = "", # Option of write code owners into devop variable
@ -20,8 +20,12 @@ function Get-CodeOwnersTool()
New-Item -ItemType Directory -Path $ToolPath | Out-Null
}
Write-Host "Installing the retrieve-codeowners tool under $ToolPath... "
dotnet tool install --tool-path $ToolPath --add-source $DevOpsFeed --version $ToolVersion "Azure.Sdk.Tools.RetrieveCodeOwners" | Out-Null
# Run command under tool path to avoid dotnet tool install command checking .csproj files.
# This is a bug for dotnet tool command. Issue: https://github.com/dotnet/sdk/issues/9623
Push-Location $ToolPath
dotnet tool install --tool-path $ToolPath --add-source $DevOpsFeed --version $ToolVersion "Azure.Sdk.Tools.RetrieveCodeOwners" | Out-Null
Pop-Location
# Test to see if the tool properly installed.
if (!(Get-Command $command -errorAction SilentlyContinue)) {
Write-Error "The retrieve-codeowners tool is not properly installed. Please check your tool path. $ToolPath"