Azure devops pipeline with multiple repositories failing if the branch not present in the repo

174 Views Asked by At

I have parametrised the repository and branch name in repositories section of my multi repo pipeline, so that one pipeline will be used to build and deploy any repository or branch name user gives. But when the branch name specified is not present any other repository mentioned in the pipeline it’s giving error.

Parameters:
- Name: codeRepoName
  Type: string
- Name: branchName
  Type: string
resources:
  repositories:
  - repository: repoOne
    type: git
    ref: ${{parameter.branchName}}
    name: repoOne
  - repository: repoTwo
    type: git
    ref: ${{parameter.branchName}}
    name: repoTwo
     
/* multiple repos listed */
    
Checkout: ${{ parameter.codeRepoName }}
     
/* build and deploy stages */
    

If the specified branch name is present in all the repos pipeline will work if the branch name is not present in any one of the repositories the pipeline will fail.

I just need pipeline to run on specified repo and branch name, even though branch is not present in other repos.

0

There are 0 best solutions below