Skip to content

Commit

Permalink
Enable passing devops pat for work item scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
weshaggard committed Feb 9, 2021
1 parent 861f1cb commit 4b899b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
3 changes: 2 additions & 1 deletion eng/common/scripts/Update-DevOps-Release-WorkItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4b899b3

Please sign in to comment.