Using Paket with Github Packages

Steve Ellwood
1 min readNov 26, 2021

I’ve already discussed how to publish packages to Github so I won’t repeat all that here. What I will cover is how to use Github as a package source in paket. Note that this works just as well for private repos as it does for public ones.

The first thing you need is an Access Token, you can either use an existing one such as the one you might have created to push your repos or use a new one. The only permissions you need for this are Read:Packages.

If you were doing this with nuget you could follow the instruction on Github that explain how to add a nuget.config file. Unfortunately paket doesn’t make full use of this file. When I tried a

paket convert-from-nuget

then the source was added but no credentials.

Fortunately the solution to this (as with all things paket) is quite straightforward.

To determine the correct source that you need you use the following

https://nuget.pkg.github.com/MyOrganisation/index.json username:"MyUser" password: "MyAccessToken" 

and substitute your organisation or your username for MyOrganisation. Put your user name into MyUser and your token value into MyAccessToken.

You end up with something like this at the top of paket.dependencies

source https://nuget.pkg.github.com/MyOrg/index.json username: "Me" password: "abc123"

This will now work as a source just like any other.

--

--

Steve Ellwood

Senior Integrations Officer at Doncaster Council Any views expressed are entirely my own.