npm
in Github Actions not able to access private repository dependency
#26638
-
I have a react native app that uses a native module which is in a different repository. Both my application and the module library are in private repos on Github, under my company’s organization. But both are private repos. I have the module listed in my
And I have a Github Action that checks out the repository and does a
But I get this message:
At first I thought this was an authorization issue, and used this action along with an access token to ensure that the container has access to my private repos. My configuration now looks like:
I’m even able to clone the private repository now: It clearly has access but yet when I try installing, it doesn’t work. It gives me the same
error. It actually looks like the error is happening when npm is trying to run this command:
Apparently this command doesn’t have any output. I’ve tried it on my own machine, and I’m getting this:
I suspected that maybe
So I’m really confused why Thanks ❤️ |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Hi @ArshanKhanifar 👋 Hopefully this issue has been resolved, but if not then you could perhaps use the full URL to the private github repository that includes credentials, but expose them via the secrets variables, rather than hardcode:
Another option is to also get an SSH key available on the repo/action workflow and use this syntax:
See this stackoverflow answer too: node.js - How to use private Github repo as npm dependency - Stack Overflow |
Beta Was this translation helpful? Give feedback.
-
I actually tried a whole bunch of things and eventually solved this, but I think what particularly worked was making a
|
Beta Was this translation helpful? Give feedback.
-
Gotcha. Thanks for the update! |
Beta Was this translation helpful? Give feedback.
-
Adding “persist-credentials: false” on “actions/checkout@v2” solved the issue for me.
|
Beta Was this translation helpful? Give feedback.
-
Can someone help me? I have tried a thousand different things and have no clue of what could be causing this!!! I'm using NPM (already tried with Yarn and no success). UPDATE: |
Beta Was this translation helpful? Give feedback.
I actually tried a whole bunch of things and eventually solved this, but I think what particularly worked was making a
.yarnrc
file and adding this line to it: