How do I download a file from a private Github repository?

Asked

Viewed 527 times

0

Hi! All right?

I’m developing a Javascript project and wanted to create a small image bank for it on Github. But I wanted to keep it private, only I don’t know how I can get the URL of an image when the image is private. I tried with the username:password but nd... Maybe it’s for Token, but I also did not learn to mess with it.

If anyone knew, it would help me a lot! Or if someone has a suggestion of another system they can do using JS, I also accept.

Note: It would be many images, so put them in the project folder and host everything, it would be kind of unfeasible.

  • 2

    It should be easier to play on a S3 volume of Amazon AWS configured for public access.

  • Would it be for use in production? The problem there is that the key would be open in your js... so the above idea of using a volume or putting in a CDN is more feasible

1 answer

1


Try this one example: download the file baz of the version 0.1.3 from a private Github repository to the folder /tmp, you would do the following:

GITHUB_OAUTH_TOKEN="seu token"
fetch --repo="https://github.com/usuario/teste" --tag="0.1.3" --source-path="/baz" /tmp

I hope it helps.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.