Hi, my site has a dependency which is a private GitHub repository like this:
In package.json:
...
"dependencies": {
"library": "myusername/library",
...
},
...
I’ve authorized Digital Ocean to access all my repositories but during the build, the library package cannot be retrieved, erroring with:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
What I’ve tried:
What is the correct way of adding this library package dependency such that it can be fetched during build?
I’d really appreciate any help.
Thank!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
👋🏼 @dwf
I also did some googling and couldn’t find anything. Although I did find this workaround—check it out: https://stackoverflow.com/a/56639755. It will let you store your GitHub access token in an environment variable.
Another option might be to mirror the packages to a private npm registry, and use yarnrc to read the credentials from an env var: https://yarnpkg.com/configuration/yarnrc
Same here :-/
Dependency’s repo access is explicitely authorized to DigitalOcean (I could deploy that repo as an app on its own) but when yarn/npm fetches it as a dependency, it fails to authenticate.
Using a Github token is a very crappy solution, as the token gives read/write access to all repos.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.