I am trying to checkout repository in Azure pipeline which is different then self repo but in same Organization. Here repository name and project name will be passed as input parameter .
I have tried by following example in https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops but not able to pass with parameter.
I have tried with syntex as below, but not get success.
resources:
repositories:
- repository: MyAzureReposGitRepository
type: git
name: $(project)/$(repo)
ref: $(branch)
Also have tried like
- checkout: git://${{ variables.repoName}}@${{ variables.branchRef }}
But here getting error at time of running pipeline
The String must have at least one character. Parameter name:repositoryName
Please help if you have any other way to make it success.
2
Answers
Since you are talking about parameters I’m assuming you are using templates. I was able to achieve the desired result with the following code
According to this thread Pipeline resource Version property as a variable:
While we can’t allow variables in that field, this is an excellent use case for runtime parameters.
So, we could not use variable
$(project)/$(repo)
in the resources.To resolve this issue, we could use the Checking out a specific ref:
And
The test result: