GitHub Package Registry and GitHub Actions - 500 Bad Request

Because the .nupkg file size got large to the point that when uploading the package to NuGet Gallery or GitHub Package Registry, it fails with either timeout errors or connection reset by peer errors, I have used GitHub Actions as the last resort.

I have implemented the logic where it uploads the resulting package to the NuGet Gallery, and it worked fine with the correct authentication credentials. Now, I am trying to implement the same logic for GitHub Package Registry.

When I am finished, it gets to the last step successfully, and after 2 seconds of upload, it errors out with 500 Bad Request. I was able to upload the older version of the app to the registry locally. I made sure that I have got everything right, including the username and the password.

The current run which failed is here:

The logic file:

How can I overcome this problem?

Turns out that I have to add RepositoryUrl and RepositoryType inside the project file. However, it’s deemed strange as to why would it publish locally on my computer earlier without the two required properties.

I have checked the error message as written in the failed “successful” run, and it says that I have to add them. The error message is written in the CURL output.

X-Nuget-Warning: No destination repository detected. Ensure the source project has a ‘RepositoryUrl’ property defined. If you’re using a nuspec file, ensure that it has a repository element with the required ‘type’ and ‘url’ attributes.

The failed “successful” run:

The successful run:

The final logic file:

The project file:

1 Like