Enable passing devops pat for work item scripts (#1670)

Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
Azure SDK Bot 2021-02-11 11:12:18 -08:00 committed by GitHub
parent 3282a05d49
commit e99c6df201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -799,7 +799,7 @@ function UpdatePackageVersions($pkgWorkItem, $plannedVersions, $shippedVersions)
$body = "[" + ($fieldUpdates -join ',') + "]"
$headers = $null
if ($devops_pat)
if (Get-Variable -Name "devops_pat" -ValueOnly -ErrorAction "Ignore")
{
$encodedToken = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes([string]::Format("{0}:{1}", "", $devops_pat)))
$headers = @{ Authorization = "Basic $encodedToken" }

View File

@ -12,7 +12,8 @@ param(
[string]$packageDisplayName = $null,
[string]$packageRepoPath = "NA",
[string]$packageType = "client",
[string]$packageNewLibrary = "true"
[string]$packageNewLibrary = "true",
[string]$devops_pat = $env:DEVOPS_PAT
)
Set-StrictMode -Version 3