npm install
在GitHub Workflow CI中安装npm依赖项。然而,我遇到了以下错误: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",
},
...
通过npm在github上安装some-package
。该仓库与工作流程所在的组织相同。要在本地解决此问题,您需要设置与该组织相关联的Github帐户的ssh密钥。
但是,在我不使用个人Github帐户的工作流CI中,如何解决此问题以便能够通过github存储库安装该软件包。