Skip to content

Commit 1224855

Browse files
Enable passing devops pat for work item scripts (Azure#18698)
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
1 parent e572f2b commit 1224855

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ function UpdatePackageVersions($pkgWorkItem, $plannedVersions, $shippedVersions)
799799
$body = "[" + ($fieldUpdates -join ',') + "]"
800800

801801
$headers = $null
802-
if ($devops_pat)
802+
if (Get-Variable -Name "devops_pat" -ValueOnly -ErrorAction "Ignore")
803803
{
804804
$encodedToken = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes([string]::Format("{0}:{1}", "", $devops_pat)))
805805
$headers = @{ Authorization = "Basic $encodedToken" }

eng/common/scripts/Update-DevOps-Release-WorkItem.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ param(
1212
[string]$packageDisplayName = $null,
1313
[string]$packageRepoPath = "NA",
1414
[string]$packageType = "client",
15-
[string]$packageNewLibrary = "true"
15+
[string]$packageNewLibrary = "true",
16+
[string]$devops_pat = $env:DEVOPS_PAT
1617
)
1718
Set-StrictMode -Version 3
1819

0 commit comments

Comments
 (0)