From 5f5ab590bb420d18e8f5b7e9af2216f663bf2246 Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:27:24 -0700 Subject: [PATCH] Handle when no "direct" packages are changed (#37599) * ensure the default isn't "scan the entire repo" --- eng/pipelines/templates/jobs/ci.yml | 4 ++-- eng/pipelines/templates/steps/resolve-package-targeting.yml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 8d4b2438e53b..ef7191fff84d 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -138,7 +138,7 @@ jobs: parameters: BuildTargetingString: ${{ parameters.BuildTargetingString }} PackagePropertiesFolder: $(Build.ArtifactStagingDirectory)/PackageInfo - IncludeIndirect: true + IncludeIndirect: false - template: /eng/pipelines/templates/steps/build-extended-artifacts.yml parameters: @@ -170,7 +170,7 @@ jobs: parameters: BuildTargetingString: ${{ parameters.BuildTargetingString }} PackagePropertiesFolder: $(Build.ArtifactStagingDirectory)/PackageInfo - IncludeIndirect: true + IncludeIndirect: false - template: ../steps/build-extended-artifacts.yml parameters: diff --git a/eng/pipelines/templates/steps/resolve-package-targeting.yml b/eng/pipelines/templates/steps/resolve-package-targeting.yml index 8ce66b7e2cac..f107489ba000 100644 --- a/eng/pipelines/templates/steps/resolve-package-targeting.yml +++ b/eng/pipelines/templates/steps/resolve-package-targeting.yml @@ -33,6 +33,12 @@ steps: } $setting = $packageProperties -join "," + + # in case we don't expect any packages, we should set the variable to null, which will match NO packages and cause whatever the check + # is to skip with exit 0 (which is what we want!) + if (-not $setting) { + $setting = "null" + } } }