Skip to content

Commit ac9424e

Browse files
azure-sdkbenbp
andauthored
Sync eng/common directory with azure-sdk-tools for PR 7854 (#28871)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#7854 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
1 parent ecbebf5 commit ac9424e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

eng/common/scripts/job-matrix/job-matrix-functions.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ function GenerateMatrix(
9696
[String]$displayNameFilter = ".*",
9797
[Array]$filters = @(),
9898
[Array]$replace = @(),
99-
[Array]$nonSparseParameters = @()
99+
[Array]$nonSparseParameters = @(),
100+
[Switch]$skipEnvironmentVariables
100101
) {
101102
$matrixParameters, $importedMatrix, $combinedDisplayNameLookup = `
102103
ProcessImport $config.matrixParameters $selectFromMatrixType $nonSparseParameters $config.displayNamesLookup
@@ -124,7 +125,9 @@ function GenerateMatrix(
124125

125126
$matrix = FilterMatrix $matrix $filters
126127
$matrix = ProcessReplace $matrix $replace $combinedDisplayNameLookup
127-
$matrix = ProcessEnvironmentVariableReferences $matrix $combinedDisplayNameLookup
128+
if (!$skipEnvironmentVariables) {
129+
$matrix = ProcessEnvironmentVariableReferences $matrix $combinedDisplayNameLookup
130+
}
128131
$matrix = FilterMatrixDisplayName $matrix $displayNameFilter
129132
return $matrix
130133
}
@@ -427,10 +430,14 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n
427430
exit 1
428431
}
429432
$importedMatrixConfig = GetMatrixConfigFromFile (Get-Content -Raw $importPath)
433+
# Add skipEnvironmentVariables so we don't process environment variables on import
434+
# because we want top level filters to work against the the env key, not the value.
435+
# The environment variables will get resolved after the import.
430436
$importedMatrix = GenerateMatrix `
431437
-config $importedMatrixConfig `
432438
-selectFromMatrixType $selection `
433-
-nonSparseParameters $nonSparseParameters
439+
-nonSparseParameters $nonSparseParameters `
440+
-skipEnvironmentVariables
434441

435442
$combinedDisplayNameLookup = $importedMatrixConfig.displayNamesLookup
436443
foreach ($lookup in $displayNamesLookup.GetEnumerator()) {

0 commit comments

Comments
 (0)