Skip to content

Commit a941e86

Browse files
authored
Fix the issue that PR changed files list is empty (#14202)
* Fix the issue that PR changed files list is empty * Fix the issue that PR changed files list is empty Co-authored-by: wyunchi <[email protected]>
1 parent fcaddf8 commit a941e86

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/CIFilterTask.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,26 @@ public override bool Execute()
414414
var csprojMap = ReadMapFile(CsprojMapFilePath, "CsprojMapFilePath");
415415

416416
Console.WriteLine(string.Format("FilesChanged: {0}", FilesChanged.Length));
417-
if (FilesChanged != null && FilesChanged.Length > 0)
417+
if (FilesChanged != null)
418418
{
419-
return ProcessFileChanged(csprojMap);
419+
if (FilesChanged.Length > 0)
420+
{
421+
return ProcessFileChanged(csprojMap);
422+
}
423+
else
424+
{
425+
Dictionary<string, HashSet<string>> influencedModuleInfo = new Dictionary<string, HashSet<string>>
426+
{
427+
[BUILD_PHASE] = new HashSet<string>() { ACCOUNT_MODULE_NAME },
428+
[ANALYSIS_BREAKING_CHANGE_PHASE] = new HashSet<string>() { ACCOUNT_MODULE_NAME },
429+
[ANALYSIS_DEPENDENCY_PHASE] = new HashSet<string>() { ACCOUNT_MODULE_NAME },
430+
[ANALYSIS_HELP_PHASE] = new HashSet<string>() { ACCOUNT_MODULE_NAME },
431+
[ANALYSIS_SIGNATURE_PHASE] = new HashSet<string>() { ACCOUNT_MODULE_NAME },
432+
[TEST_PHASE] = new HashSet<string>() { ACCOUNT_MODULE_NAME }
433+
};
434+
FilterTaskResult.PhaseInfo = CalculateCsprojForBuildAndTest(influencedModuleInfo, csprojMap);
435+
return true;
436+
}
420437
}
421438
else if (!string.IsNullOrWhiteSpace(TargetModule))
422439
{

0 commit comments

Comments
 (0)