简体   繁体   中英

dotnet restore in Github Actions gives 401 unauthorized

a.NET6 project on Github cannot be do.net-restored in Github Actions. do.net restore works fine locally. Looking at the Action logs , it seems GH looks for Microsoft dependencies in my Github Packages Repo. System.Linq is MS-stuff.

  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]

Further below in the pipeline there is a step to publish the result to the Github Packages registry, however in the project itself I am only using public NUGET references. I am not sure why GH Actions looks for the.NET stuff in my registry. I even have the public Nuget feed configured in my nuget.config :

<?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>

Does anyone know what;s the problem here?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM