From b844feb2b2a5e99e4f11b6a5103e0ff8933bf29b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 10 Jul 2024 17:26:57 -0400 Subject: [PATCH] add the ability to override default succeeded() conditioning by parameter (#44937) Co-authored-by: Scott Beddall --- .../pipelines/templates/steps/daily-dev-build-variable.yml | 5 +++-- eng/common/pipelines/templates/steps/verify-changelog.yml | 4 ++++ eng/common/pipelines/templates/steps/verify-path-length.yml | 4 +++- eng/common/pipelines/templates/steps/verify-readme.yml | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml index 5d53a5265c7af..37efd0bd0312f 100644 --- a/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml +++ b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml @@ -2,6 +2,7 @@ # is used when this pipeline is going to be generating and publishing daily dev builds. parameters: ServiceDirectory: '' + Condition: succeeded() steps: - ${{if ne(parameters.ServiceDirectory, '')}}: - task: Powershell@2 @@ -13,7 +14,7 @@ steps: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Dump Package properties - condition: succeeded() + condition: ${{ parameters.Condition }} - pwsh: | $setDailyDevBuild = "false" if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) { @@ -21,4 +22,4 @@ steps: } echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild" displayName: "Setup Versioning Properties" - condition: and(succeeded(), eq(variables['SetDevVersion'], '')) + condition: and(${{ parameters.Condition }}, eq(variables['SetDevVersion'], '')) diff --git a/eng/common/pipelines/templates/steps/verify-changelog.yml b/eng/common/pipelines/templates/steps/verify-changelog.yml index 887ad1a97d901..113e0a5e695a7 100644 --- a/eng/common/pipelines/templates/steps/verify-changelog.yml +++ b/eng/common/pipelines/templates/steps/verify-changelog.yml @@ -11,6 +11,9 @@ parameters: - name: ForRelease type: boolean default: false +- name: Condition + type: string + default: succeeded() steps: - task: Powershell@2 @@ -23,4 +26,5 @@ steps: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Verify ChangeLogEntry for ${{ parameters.PackageName }} + condition: ${{ parameters.Condition }} continueOnError: false diff --git a/eng/common/pipelines/templates/steps/verify-path-length.yml b/eng/common/pipelines/templates/steps/verify-path-length.yml index e797292169011..259c663b9dc3f 100644 --- a/eng/common/pipelines/templates/steps/verify-path-length.yml +++ b/eng/common/pipelines/templates/steps/verify-path-length.yml @@ -1,11 +1,13 @@ # Template for all Python Scripts in this repository -parameters: +parameters: SourceDirectory: '' BasePathLength: 49 + Condition: succeeded() steps: - task: PythonScript@0 displayName: Analyze Path Lengths + condition: ${{ parameters.Condition }} inputs: scriptSource: inline script: | diff --git a/eng/common/pipelines/templates/steps/verify-readme.yml b/eng/common/pipelines/templates/steps/verify-readme.yml index 7b9217ade3e21..6eeb174b323b6 100644 --- a/eng/common/pipelines/templates/steps/verify-readme.yml +++ b/eng/common/pipelines/templates/steps/verify-readme.yml @@ -15,10 +15,14 @@ parameters: - name: DocWardenVersion type: string default: '' +- name: Condition + type: string + default: succeeded() steps: - task: PowerShell@2 displayName: "Verify Readmes" + condition: ${{ parameters.Condition }} inputs: filePath: "eng/common/scripts/Verify-Readme.ps1" arguments: >