diff --git a/eng/common/pipelines/templates/steps/set-default-branch.yml b/eng/common/pipelines/templates/steps/set-default-branch.yml index 31bf289361..12ec1be317 100644 --- a/eng/common/pipelines/templates/steps/set-default-branch.yml +++ b/eng/common/pipelines/templates/steps/set-default-branch.yml @@ -2,6 +2,7 @@ parameters: WorkingDirectory: '$(System.DefaultWorkingDirectory)' RemoteRepo: 'origin' DefaultBranchVariableName: DefaultBranch + Condition: 'succeeded()' steps: - pwsh: | $setDefaultBranch = (git remote show ${{ parameters.RemoteRepo }} | Out-String) -replace "(?ms).*HEAD branch: (\w+).*", '$1' @@ -13,4 +14,5 @@ steps: Write-Host "##vso[task.setvariable variable=${{ parameters.DefaultBranchVariableName }}]$setDefaultBranch" displayName: "Setup Default Branch" workingDirectory: ${{ parameters.workingDirectory }} + condition: ${{ parameters.Condition }} ignoreLASTEXITCODE: true diff --git a/eng/common/pipelines/templates/steps/verify-links.yml b/eng/common/pipelines/templates/steps/verify-links.yml index 8a84f8d0ec..4d84e124a8 100644 --- a/eng/common/pipelines/templates/steps/verify-links.yml +++ b/eng/common/pipelines/templates/steps/verify-links.yml @@ -12,6 +12,8 @@ parameters: steps: - template: /eng/common/pipelines/templates/steps/set-default-branch.yml + parameters: + Condition: ${{ parameters.Condition }} - task: PowerShell@2 displayName: Link verification check condition: ${{ parameters.Condition }}