【问题标题】:Replace Tokens Task Ambiguity Issue in Azure YAML pipeline在 Azure YAML 管道中替换令牌任务歧义问题
【发布时间】:2021-12-21 11:31:58
【问题描述】:

我在 Azure 的 YAML 管道中遇到了一些特定任务的命名空间冲突问题。这是我遇到问题的“替换令牌”任务的代码:

      - task: replacetokens@4
        displayName: Replace tokens in localSettings.xml
        inputs:
          rootDirectory: '$(System.DefaultWorkingDirectory)\path_to_tests'
          targetFiles: 'localSettings.xml'
          encoding: 'auto'
          tokenPattern: 'default'
          writeBOM: true
          actionOnMissing: 'warn'
          keepToken: false
          actionOnNoFiles: 'continue'
          enableTransforms: false
          useLegacyPattern: false
          enableTelemetry: true

它在编译时工作正常。没有问题。但是,当我尝试运行管道时出现此运行时错误:

Job DEV_Tests: Step task reference is invalid. The task name replacetokens is ambiguous. Specify one of the following identifiers to resolve the ambiguity: qetza.replacetokens.replacetokens-task.replacetokens, colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens

在我看来,“replacetokens@4”有多个版本,这就是为什么我得到这个模棱两可的错误。但是,当我尝试按照错误中的建议使用“qetza”或“colinsalmcorner”命名空间时,我收到另一个编译时错误建议,即这些命名空间不存在:

String does not match the pattern of "^UseRubyVersion@0$".

Value is not accepted. Valid values: "UseRubyVersion@0", "deployApi@3", "deployApi@4", "deployApi@5", "ReviewApp@0", "AzureAPIImport@1", "AzureAPIImport@3", "AzureAPIImport@4", "AzureAPIImport@5", "AzureAPIImport@6", "AzureAPIUrlImport@0", "AzureAPIImport@2", "AppCenterDistribute@2", "AppCenterDistribute@3", "AppCenterDistribute@1", "AppCenterDistribute@0", "CopyFiles@2", "C

任何想法为什么这些命名空间在管道中未被识别,但“replacetokens@4”被识别为命名空间冲突?

【问题讨论】:

    标签: azure-devops yaml azure-pipelines azure-pipelines-yaml azure-pipelines-tasks


    【解决方案1】:

    我检查了这个,当我使用完整命名空间时得到的只是这样的警告:

    这可能是用于验证的架构不允许使用全名,但这只是一个警告。

    当我验证管道时,我得到了OK

    【讨论】:

      猜你喜欢
      • 2022-06-28
      • 1970-01-01
      • 2020-08-27
      • 1970-01-01
      • 2020-08-07
      • 1970-01-01
      • 1970-01-01
      • 2022-01-03
      • 2020-05-28
      相关资源
      最近更新 更多