首页 > 解决方案 > 如何将 SSH 密钥添加到本地 CircleCI 构建?

问题描述

我正在尝试通过运行在本地运行 CircleCI 测试作业

circleci local execute --job test

但是,我收到此错误消息:

go: github.com/some/repo@v0.0.0-20180921204022-800easdf7ec: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /go/pkg/mod/cache/vcs/52f8e69c46f5a1cc77e6bf: exit status 128:
    fatal: could not read Username for 'https://github.com': terminal prompts disabled

我基本上想为本地 CircleCI 环境做相当于https://circleci.com/docs/2.0/add-ssh-key/的操作,但是没有办法去项目设置-> 如上所述检查 SSH 密钥在那个文档中。我已阅读https://circleci.com/docs/2.0/local-cli/#run-a-job-in-a-container-on-your-machine上的文档,但找不到方法去做这个。

知道如何在本地 CircleCI 环境中从私有 Github 存储库中查看代码吗?

标签: sshcirclecicircleci-2.0

解决方案


您是否尝试过将密钥添加到您的 SSH 钥匙串?

ssh-add (location of ssh key)

这应该将它添加到钥匙串和 CircleCI 本地应该拿起它。


推荐阅读