Azure Pipelines GitHub软件包不起作用

问题描述

按照此处的说明进行操作:

https://docs.microsoft.com/en-us/azure/devops/release-notes/2020/pipelines/sprint-170-update

具有以下内容

  packages:
  - package: MyPkg
    type: NuGet
    connection: github
    name: TheOrg/TheRepo/ThePkg
    version: '*'

    - getPackage: MyPkg

Azure Pipelines似乎无法正确地做到这一点。我不确定这将如何通过基本测试。

日志显示

Using authentication @R_378_4045@ion for the following URI: https://nuget.pkg.github.com/{ThePATUser}/index.json

那是错误的...我指定了一个组织。生成PAT的用户不是我要消耗的NuGet提要

然后

"C:\Program Files\dotnet\dotnet.exe" add d:\a\1\Nuget\dotnet\tempCsproj_67.csproj package TheRepo -v * -n

这显然也是错误的。这个功能真的有用吗?

我查看了该任务的源代码https://github.com/microsoft/azure-pipelines-tasks/pull/12292/files#diff-6aadc4d5fa0b434a99fe35ba9d3d2ac4R55

根据我的判断,这只是错误的逻辑。非常感谢MS的某人确认此代码确实不起作用。

解决方法

我可以重现同样的问题。无法使用getPackage步骤检索github软件包。提要网址将评估为PAT用户提要网址,而不是组织提要网址。

您可以单击this link将此问题报告给Microsoft开发团队。希望他们会调查此问题并尽快提供解决方案!