File tree 3 files changed +13
-8
lines changed
PipelineSteps/BatchGeneration
3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
[CmdletBinding (DefaultParameterSetName = " AllSet" )]
2
2
param (
3
- [int ]$MaxParallelJobs = 3
3
+ [int ]$MaxParallelJobs = 3 ,
4
+ [string []]$ChangedFiles
4
5
)
5
6
6
- $base = git merge-base HEAD origin/ main
7
- $changedFiles = git diff -- name- only $base HEAD
8
-
9
7
$autorestFolders = @ {}
10
8
11
9
foreach ($file in $changedFiles ) {
@@ -19,7 +17,7 @@ foreach ($file in $changedFiles) {
19
17
}
20
18
21
19
$subModules = $autorestFolders.Keys
22
-
20
+ Write-Host " Outer Group ${subModules} : "
23
21
24
22
function Split-List {
25
23
param (
@@ -61,5 +59,7 @@ foreach ($subModules in $devidedSubModules) {
61
59
$index ++
62
60
}
63
61
64
- $MatrixStr = $MatrixStr.Substring (1 )
62
+ if ($MatrixStr -and $MatrixStr.Length -gt 1 ) {
63
+ $MatrixStr = $MatrixStr.Substring (1 )
64
+ }
65
65
Write-Host " ##vso[task.setVariable variable=analyzeTargets;isOutput=true]{$MatrixStr }"
Original file line number Diff line number Diff line change @@ -77,5 +77,7 @@ foreach ($subModules in $devidedSubModules) {
77
77
$index ++
78
78
}
79
79
80
- $MatrixStr = $MatrixStr.Substring (1 )
80
+ if ($MatrixStr -and $MatrixStr.Length -gt 1 ) {
81
+ $MatrixStr = $MatrixStr.Substring (1 )
82
+ }
81
83
Write-Host " ##vso[task.setVariable variable=buildTargets;isOutput=true]{$MatrixStr }"
Original file line number Diff line number Diff line change @@ -165,11 +165,14 @@ jobs:
165
165
git commit -m "Apply matrix job patches to ${{ variables.GenerationBranch }}"
166
166
git push origin "${{ variables.GenerationBranch }}"
167
167
168
+ $base = git merge-base HEAD origin/main
169
+ $changedFiles = git diff --name-only $base HEAD
170
+
168
171
$sourceBranchName = "$(Build.SourceBranch)".Replace('refs/heads/', '')
169
172
git checkout $sourceBranchName
170
173
171
174
$filterModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'filter.ps1'
172
- & $filterModulesPath -MaxParallelJobs "${{ variables.MaxParalleAnalyzeJobs }}"
175
+ & $filterModulesPath -MaxParallelJobs "${{ variables.MaxParalleAnalyzeJobs }}" -ChangedFiles $changedFiles
173
176
# -RepoRoot "$(Build.SourcesDirectory)" -MaxParallelJobs "${{ variables.MaxParalleBuildJobs }}"
174
177
175
178
# - checkout: none
You can’t perform that action at this time.
0 commit comments