Github Actions 中的 dotnet 还原给出 401 未经授权

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

GitHub 上的 NET6 项目无法在 GitHub Actions 中进行 dotnet 恢复。

dotnet restore
在本地运行良好。查看操作日志,GH 似乎在my GitHub Packages Repo 中查找 Microsoft 依赖项。
System.Linq
是 MS 的东西。

  Retrying 'FindPackagesByIdAsync' for source 'https://nuget.pkg.github.com/mdddev/download/system.linq/index.json'.
  Response status code does not indicate success: 401 (Unauthorized).
/home/runner/.dotnet/sdk/6.0.202/NuGet.targets(130,5): warning : Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured. [/home/runner/work/meh/meh/meh.sln]

在管道的更下方,有一个步骤将结果发布到 GitHub Packages 注册表,但是在项目本身中,我仅使用公共 NuGet 引用。我不确定为什么 GH Actions 在我的注册表中查找 .NET 内容。我什至在我的

nuget.config
:

中配置了公共 NuGet feed
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <clear />
        <add key="nuget" value="https://api.nuget.org/v3/index.json" />
        <add key="github" value="https://nuget.pkg.github.com/mdddev/index.json" />
    </packageSources>
</configuration>

有谁知道这里出了什么问题吗?

c# nuget github-actions .net-6.0 github-package-registry
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.