Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: az devops takes heading space as part of value #429

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Arcus.Scripting.DevOps/Arcus.Scripting.DevOps.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function Set-AzDevOpsVariable {
)

if ($AsSecret) {
Write-Host "##vso[task.setvariable variable=$Name;issecret=true] $Value"
Write-Host "##vso[task.setvariable variable=$Name;issecret=true]$Value"
} else {
Write-Host "##vso[task.setvariable variable=$Name] $Value"
Write-Host "##vso[task.setvariable variable=$Name]$Value"
}
}

Expand Down Expand Up @@ -105,4 +105,4 @@ function Save-AzDevOpsBuild {
. $PSScriptRoot\Scripts\Save-AzDevOpsBuild.ps1 -ProjectId $ProjectId -BuildId $BuildId -DaysToKeep $DaysToKeep
}

Export-ModuleMember -Function Save-AzDevOpsBuild
Export-ModuleMember -Function Save-AzDevOpsBuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ InModuleScope Arcus.Scripting.DevOps {
Context "Setting ARM outputs to Azure DevOps variable group" {
It "Setting DevOps variable should write to host" {
# Arrange
Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test] value" } -Verifiable
Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test]value" } -Verifiable

# Act
Set-AzDevOpsVariable "test" "value"
Expand All @@ -15,7 +15,7 @@ InModuleScope Arcus.Scripting.DevOps {
}
It "Setting DevOps variable as secret should write to host" {
# Arrange
Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test;issecret=true] value" } -Verifiable
Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test;issecret=true]value" } -Verifiable

# Act
Set-AzDevOpsVariable "test" "value" -AsSecret
Expand Down