【发布时间】:2020-09-04 17:29:41
【问题描述】:
我正在尝试通过运行npm install 在 github 工作流 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",
},
...
这个some-package 正在由 npm 通过 github 安装。存储库与运行工作流的组织位于同一组织内。要在本地解决此问题,您可以在与组织相关联的 github 帐户上设置 ssh 密钥。
但是我该如何解决这个问题,以便它能够通过工作流 ci 中的 github repo 安装该软件包,而我没有使用我的个人 github 帐户。
【问题讨论】:
标签: node.js git github github-actions