I am trying to install npm dependencies within a github workflow ci by running npm install
. However i get the following error:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/private-org/private-repo.git
npm ERR!
npm ERR! Warning: Permanently added the RSA host key for IP address 'removed' to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
ci.yml
name: CI
on:
push:
branches: [master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: node --version
- run: npm install
package.json
...
"dependencies": {
"some-pacakage": "git+ssh://git@github.com/private-org/private-repo.gitt",
},
...
This some-package
is being installed via github by npm. The repo is within the same organization as which the workflow is running in. To solve this problem locally you setup ssh key on your github account tied to the organization.
But how can i solve this issue so that its able to install that package via github repo within the workfow ci where im not using my personal github account.