获取管道时发生错误。存储库需要一个端点参数名称:endpoint

问题描述 投票:0回答:1

尝试从 Azure Devops 中编辑管道时看到以下错误

当我单击编辑器中的“查看模板”链接时,会发生这种情况

stages:
  View Template
  - template: applications/deploy.yaml@mydevops
    parameters:
      TARGET_ENV: dev

但是模板本身的验证正在通过。我怀疑这可能与两条结账线有关。但验证正在通过。我确实需要检查源存储库以及模板所在的存储库

模板是deploy.yaml:

stages:
  - stage: Deploy
    displayName: Deploy stage

    jobs:
      - deployment: Deploy
        displayName: Deploy
        pool:
          name: self-hosted
        strategy:
          runOnce:
            deploy:
              steps:
                - checkout: mydevops
                - checkout: self
azure-devops azure-pipelines
1个回答
0
投票

该错误似乎表明您正在使用

repository
资源,但未设置
endpoint
属性。

来自 定义存储库资源

resources:
    repositories:
    - repository: string # Required as first property. Alias for the repository.
      endpoint: string # ID of the service endpoint connecting to this repository.
      trigger: none | trigger | [ string ] # CI trigger for this repository, no CI trigger if skipped (only works for Azure Repos).
      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.
      type: string # Type of repository: git, github, githubenterprise, and bitbucket.

示例来自 检查管道中的多个存储库

resources:
  repositories:
  - repository: MyGitHubRepo 
    type: github
    endpoint: MyGitHubServiceConnection # ID of the service endpoint connecting
    name: MyGitHubOrgOrUser/MyGitHubRepo
  - repository: MyBitbucketRepo
    type: bitbucket
    endpoint: MyBitbucketServiceConnection # ID of the service endpoint connecting
    name: MyBitbucketOrgOrUser/MyBitbucketRepo
  - repository: MyAzureReposGitRepository 
    endpoint: MyAzureReposGitServiceConnection # ID of the service endpoint connecting
    type: git
    name: OtherProject/MyAzureReposGitRepo

trigger:
- main

pool:
  vmImage: 'ubuntu-latest'

steps:
- checkout: self
- checkout: MyGitHubRepo
- checkout: MyBitbucketRepo
- checkout: MyAzureReposGitRepository

- script: dir $(Build.SourcesDirectory)
© www.soinside.com 2019 - 2024. All rights reserved.