diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index 5d06154d665..f6043eec4c1 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -11,6 +11,9 @@ parameters: - name: SkipDefaultCheckout type: boolean default: false + - name: SkipEngCheckout + type: boolean + default: false steps: - ${{ if not(parameters.SkipDefaultCheckout) }}: @@ -28,6 +31,12 @@ steps: displayName: Init sparse checkout ${{ repo.Name }} workingDirectory: ${{ coalesce(repo.WorkingDirectory, format('{0}/{1}', '$(System.DefaultWorkingDirectory)', repo.Name)) }} + - pwsh: | + git sparse-checkout set eng + displayName: Add eng folder to sparse-checkout set + condition: and(succeededOrFailed(), not(${{ parameters.SkipEngCheckout }})) + workingDirectory: ${{ coalesce(repo.WorkingDirectory, format('{0}/{1}', '$(System.DefaultWorkingDirectory)', repo.Name)) }} + - ${{ each path in parameters.Paths }}: - pwsh: git sparse-checkout add ${{ path }} displayName: Add sparse checkout path ${{ path }}