Share via


resources.repositories.repository definition

The repository keyword lets you specify an external repository. Use a repository resource to reference an additional repository in your pipeline.

repositories:
- repository: string # Required as first property. Alias for the repository.
  endpoint: string # ID of the service endpoint connecting to this repository.
  name: string # repository name (format depends on 'type'; does not accept variables).
  type: string # Type of repository: git, github, githubenterprise, and bitbucket.
  ref: string # ref name to checkout; defaults to 'refs/heads/main'. The branch checked out by default whenever the resource trigger fires. Does not accept variables.

Definitions that reference this definition: resources.repositories

Properties

repository string. Required as first property.
Alias for the specified repository. Acceptable values: [-_A-Za-z0-9]*.

endpoint string.
ID of the service endpoint connecting to this repository.

name string.
Repository name. Format depends on 'type'; does not accept variables.

ref string.
ref name to checkout; defaults to 'refs/heads/main'. The branch checked out by default whenever the resource trigger fires. Does not accept variables.

type string.
Type of repository: git, github, githubenterprise, and bitbucket.

Remarks

Important

Repository resource does not allow pipeline variables in name and ref. Wildcards are supported in triggers.

If your pipeline has templates in another repository, you must let the system know about that repository.

Types

Pipelines support the following values for the repository type: git, github, and bitbucket. The git type refers to Azure Repos Git repos.

  • If you specify type: git, the name value refers to the name of an Azure Repos Git repository.

    • If your pipeline is in the same Azure DevOps project as the repository, for example a repository named tools, you reference it using name: tools.
    • If your pipeline is in the same Azure DevOps organization as the repository, but in a different Azure DevOps project, for example a project named ToolsProject, you must qualify the repository name with the project name: name: ToolsProject/tools.
  • If you specify type: github, the name value is the full name of the GitHub repo and includes the user or organization. An example is name: Microsoft/vscode. GitHub repos require a GitHub service connection for authorization.

  • If you specify type: bitbucket, the name value is the full name of the Bitbucket Cloud repo and includes the user or organization. An example is name: MyBitbucket/vscode. Bitbucket Cloud repos require a Bitbucket Cloud service connection for authorization.

For more information about these types, see Check out multiple repositories in your pipeline - Repository resource definition.

Examples

resources:
  repositories:
  - repository: common
    type: github
    name: Contoso/CommonTools
    endpoint: MyContosoServiceConnection

See also