`error: Failed to create repository /demo due to: POST https://api.github.com/user/repos: 404 Not Found []`
I ran into this issue while running through the getting started guide for https://toolkit.fluxcd.io/get-started/. I ran into this issue while trying to create a repo from a token that I had created. Turns out I not given the token that I was using for the guide enough permissions to be able to create a repo.
Try checking the permissions of the token. That immediately resolved the issue for me.
I think Github responds with a poor response code choice in this case. Should be an unauthorised response.
was the user_name you supplied a valid github user name? btw the repository name you gave was it just demo5
or did you add a /
at the beginning? Maybe we need to strip out any leading/trailing slash characters