Can login into docker-registry but not push image (github)

So I want to use the docker registry from GitHub.
I do the flowing:

docker login docker.pkg.github.com --username username
docker build . --tag docker.pkg.github.com/user-name/repo/IMAGENAME:snapshot
docker push docker.pkg.github.com/user-name/repo/IMAGENAME:snapshot

Note that the repository is private and not mine but I got write access to it.

When I go to packages tab I can also see the instructions on how to get started and I follow them(kind of, I tag the docker image in one go).

But when I run the 3 commands at the top I get the following output(push command fails):

unauthorized: Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:packages'], but your token has only been granted the: [''] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.

When I visit the site referenced there is nothing there only unrelated tokens.

Any ideas what I could try or what may cause this…?

Source: StackOverflow