From 3127134ab865b88e6d06d08f90f75a2f97020978 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 14 Apr 2021 10:45:19 -0700 Subject: [PATCH 1/2] make eng folder checkout optional --- eng/common/pipelines/templates/steps/sparse-checkout.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index 5d06154d665..226a5d79a6c 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(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 }} From 4dfab01895cf63e3d31f140602b9684a239599d7 Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Wed, 14 Apr 2021 11:09:46 -0700 Subject: [PATCH 2/2] correctly access the parameter --- eng/common/pipelines/templates/steps/sparse-checkout.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index 226a5d79a6c..f6043eec4c1 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -34,7 +34,7 @@ steps: - pwsh: | git sparse-checkout set eng displayName: Add eng folder to sparse-checkout set - condition: and(succeededOrFailed(), not(SkipEngCheckout)) + condition: and(succeededOrFailed(), not(${{ parameters.SkipEngCheckout }})) workingDirectory: ${{ coalesce(repo.WorkingDirectory, format('{0}/{1}', '$(System.DefaultWorkingDirectory)', repo.Name)) }} - ${{ each path in parameters.Paths }}: