Skip to content

Commit a90f50a

Browse files
Copilotjohlju
andcommitted
Move output variable setting to azure-pipelines.yml inline script and clean up formatting
Co-authored-by: johlju <[email protected]>
1 parent 1ae4e34 commit a90f50a

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.build/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ The script checks for changes to:
1515
3. **Public Commands**: Commands that are actually used by DSC resources or classes (dynamically discovered)
1616
4. **Private Functions**: Functions used by the monitored public commands or class-based DSC resources
1717
5. **Integration Tests**: DSC resource integration test files under `tests/Integration/Resources/`
18-
6. **Pipeline Configuration**: Azure Pipelines configuration and build scripts
1918

2019
## Usage
2120

.build/Test-ShouldRunDscResourceIntegrationTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ if ($MyInvocation.InvocationName -ne '.')
492492
Write-Host "RESULT: DSC resource integration tests will be SKIPPED"
493493
}
494494

495-
# Set Azure DevOps output variable for pipeline conditions
496-
Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
497-
498-
# Also output as regular output for local testing
495+
# Output the result for the calling script to capture
499496
Write-Output -InputObject ""
500497
Write-Output -InputObject "ShouldRunDscResourceIntegrationTests: $shouldRun"
498+
499+
# Return the boolean value for pipeline script to use
500+
return $shouldRun
501501
}

azure-pipelines.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,15 @@ stages:
9696
if (-not $env:SYSTEM_PULLREQUEST_TARGETBRANCH) {
9797
$targetBranch = "origin/main"
9898
}
99-
99+
100100
Write-Output "Target branch: $targetBranch"
101101
Write-Output "Current branch: HEAD"
102-
102+
103103
# Run the script to determine if DSC resource integration tests should run
104-
./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD
104+
$shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD
105+
106+
# Set Azure DevOps output variable for pipeline conditions
107+
Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
105108
pwsh: true
106109

107110
- job: Test_HQRM

0 commit comments

Comments
 (0)