You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure DevOps管道检出repo1报错:仅支持self、none或仓库别名

问题原因与解决方案

你的管道配置中resources节点缩进错误,它被嵌套在了pool节点内部,导致Azure DevOps无法识别repo1这个仓库资源,因此触发检出报错。

修正后的YAML配置

trigger:
- main

pool:
  vmImage: ubuntu-latest

resources:
  repositories:
  - repository: repo1
    type: git
    name: testing/repo1
    ref: main
    trigger:
      branches:
        include:
         - main

stages:
- stage: 'Build'

  jobs:
    - job:
      steps:
      - checkout: self
      - checkout: repo1

      - script: dir $(Build.SourcesDirectory)

说明

在Azure DevOps YAML管道的结构中,resources是顶级配置节点,必须与trigger、pool等节点处于同一层级。修正缩进后,管道就能正确识别你配置的repo1仓库资源,执行checkout: repo1时就不会再报错。

内容的提问来源于stack exchange,提问作者Rattletrap

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 14:13:10