-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet nuget push fails to authenticate #101
Comments
Okay I went through the code, ran jest, did some soul-searching and finally realized that the problem was staring at me all along. <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
If you include a Now I'm not sure how to go about fixing this... I assume that changing the action to modify the repo-level nuget config is a no-no? |
I have a proposal... what if the action generates a full nuget config file that you can reference later on? Input <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration> Output <?xml version="1.0"?>
<configuration>
<config>
<add key="defaultPushSource" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
</config>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Source" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
</packageSources>
<packageSourceCredentials>
<Source>
<add key="Username" value="OwnerName"/>
<add key="ClearTextPassword" value="NUGET_AUTH_TOKEN"/>
</Source>
</packageSourceCredentials>
</configuration> The user-experience would look something like this: steps:
- id: dotnet
uses: actions/setup-dotnet@vnext
with:
source-url: https://nuget.pkg.github.com/owner/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: dotnet nuget push **/*.nupkg --config-file ${{ steps.dotnet.outputs.nugetconfig }} Unfortunately, that's not possible because dotnet nuget push does not support @ZEisinger thoughts? |
I'm running into this too and I have no idea what's going on. I've had it working before and all of a sudden it stopped.
And I get the following output:
|
I've found success setting Also off topic, but |
It seems the original problem with not using the given token would be solved by #109 (not released in v1 yet). The nuget file was being generated into a temp folder outside the repo path and was not being used. |
The release has been completed. Please reopen if the original bug is not resolved, or open a new issue for other bugs. |
Still seems to be an issue. I was getting
using the install dotnet action parameters. If I just use the |
I experience the same issue as @AndrewTriesToCode . |
My conclusion is that you have to do one of two things:
So this will never work: - uses: actions/setup-dotnet@v1
with:
config-file: nuget.config
source-url: https://nuget.pkg.github.com/OwnerName/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} <!-- Will never work, even though the NUGET_AUTH_TOKEN is added, it can't be matched to a packageSource after the <clear/> -->
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration> Option A: <!-- Will work because packageSources are now merged with the temporary nuget.config in the parent directory -->
<configuration>
<packageSources>
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration> Option B: <!-- Will also work because setup-dotnet will match your existing packageSource -->
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="gh" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
</packageSources>
</configuration> |
Description
I can't get authentication to work after reading the README section and related issues (NuGet/Home#8580 (comment)).
I want to:
Details
I have a nuget.config in my repo with just the source I need to restore dependencies.
Then I added the bit of yaml that configures the GPR source-url and adds authentication.
No matter what I do, I get an error on the last step saying that my API key is missing.
Can this be a bug in the action? I don't see what I could possibly be missing.
The text was updated successfully, but these errors were encountered: