In the package.json file, I have added a dependency that is referencing one of our public repositories. The dependency in the package.json looks like below:
"ffprobe-static": "git+https://github.com/company-name/repo-name.git",
I can successfully run npm install locally and use this dependency, but when I push this code, our GitHub workflows where we execute npm install fails with the below error:
npm ERR! Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
I don't understand the reason for this error, since the repository we are referencing is public, and also I can access the same repository when I install dependencies locally.
Note that the repository that is running this code is a private repository, but the referenced repository is public, but under the same organization.