Skip to content
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

Github: support private repository #337

Open
OlivierLDff opened this issue Apr 27, 2024 · 2 comments
Open

Github: support private repository #337

OlivierLDff opened this issue Apr 27, 2024 · 2 comments

Comments

@OlivierLDff
Copy link

Trying to use nurl on a private repository, I get an error:

HTTP error 404

       response body:

       {
         "message": "Not Found",
         "documentation_url": "https://docs.github.com/rest/commits/commits#get-a-commit"
       }
Error: command exited with exit status: 1

I see in the source code that no token are set.
Would it be possible to read optional token from env variable for example GITHUB_TOKEN. Or to be able to specify it via CLI, for example via --token?

For those interested, my current workaround it to use (this is based on some comments I found in a github issue, but I forgot to write down the author name, I adapted it to fix the deprecation warning):

nix-shell -p nix-prefetch-git jq --run "nix hash convert --hash-algo sha256 --to sri \$(nix-prefetch-git --url https://github.com/USER/REPO --quiet --rev TAG | jq -r '.sha256')"

Of course this just gives me the sha256, which is just what I need for now.

Have a nice day.

@brizzbuzz
Copy link

ideally support via ssh as well instead of relying on GitHub api 😇

@timka
Copy link

timka commented Dec 10, 2024

Using regular git SSH shorthand URL (w/o ssh:// suffix) is blocked by rust-lang/cargo#13549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants