Enable passing devops pat for work item scripts (#1670)
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
parent
3282a05d49
commit
e99c6df201
@ -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" }
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user