我想从pip install操作作业中的私有GitHub存储库中提取一个库。我可以将它安装在我的计算机上,因为我已经将GitHub配置为接受SSH密钥。但是,如何向GitHub操作运行程序提供SSH密钥呢?
在我的电脑上,它工作得很好:
python -m pip install "git+ssh://git@github.com/ORG/LIBRARY.git@main#egg=SOMETHING&subdirectory=SOMETHING"
Collecting LIBRARY
Cloning ssh://****@github.com/ORG/LIBRARY.git (to revision main) to /tmp/pip-install-_kw52ce5/LIBRARY_35c4fb5cf6a64e30914beaec4a768bd1
Installing build dependencies ... done
...
Successfully built LIBRARY-0.1.1为了保护隐私,我更改了库、组织和目录的名称。来自GitHub repos的pip安装文档是这里。
我已经尝试了这指南与这 GitHub行动没有运气。在GitHub操作中,我得到以下错误消息:
Step 15/20 : RUN pip install -r requirements.txt
---> Running in 5ece3eb6572e
Collecting LIBRARY@ git+ssh://git@github.com/ORG/LIBRARY.git@main#egg=SOMETHING&subdirectory=SOMETHING
Cloning ssh://****@github.com/ORG/LIBRARY.git (to revision main) to /tmp/pip-install-ohx86p2h/LIBRARY_2972ab1296ce45afa73bbb3c5a036bd1
Running command git clone -q 'ssh://****@github.com/ORG/LIBRARY.git' /tmp/pip-install-ohx86p2h/LIBRARY_2972ab1296ce45afa73bbb3c5a036bd1
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.如何向GitHub操作运行程序提供SSH密钥?
发布于 2021-07-22 16:11:45
我认为“主机密钥验证失败”指向了~/..ssh/知名_Host文件中的一个问题。通常,当您第一次通过ssh连接到主机时,系统会提示您使用类似于:
The authenticity of host 'domain.com (a.b.c.d)' can't be established.
RSA key fingerprint is XX:XX:...:XX.
Are you sure you want to continue connecting (yes/no)? 如果回答是,主机键将自动添加到known_hosts文件中。您可以手动将主机键添加到正在运行您的Github操作的用户的known_hosts文件中:
ssh-keyscan -H github.com >> ~/.ssh/known_hostshttps://stackoverflow.com/questions/68487345
复制相似问题