我是克隆 repob 在 repoa ,使用 repob
的部署密钥(存储在 repoa
中)。我了解这可能不是一个好习惯,无需对此发表评论(谢谢)。
工作流程 > ubuntu-20.04 ,并在 Windows-latest
上使用msys2。它可以在Ubuntu上使用,我可以在常规MSYS2安装上手动运行命令,但是它。 CI日志具有所有详细信息,必要的命令是
git -c core.sshCommand='ssh -vvv -i repoB_deployment_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' clone -b main [email protected]:eudoxos/repoB.git repoB
Windows下的故障为 加载密钥“ repob_deployment_key”:无效格式
,我无法找出出了什么问题。我尝试更改专用密钥的权限( chmod 600
),添加 -o usernownhostSfile =/dev/null
和 -o stricthostkeychecking = no
,通过 unix2dos
运行键,添加额外的尾随newline - 没有任何帮助。
同样,同一命令在ubuntu下和桌面窗口上的msys2下工作。
存储库是可以公开读到的;欢迎您打开 repoa
存储库的PR;公关应触发CI运行。
I am cloning repoB within GitHub CI workflow of repoA, using deployment key of repoB
(stored in repoA
). I understand this might not be a good practice, no need to comment on that (thanks).
The workflow tests this procedure natively on ubuntu-20.04
and using MSYS2 on windows-latest
. It works on Ubuntu, I can run the commands manually on regular MSYS2 installation, but it fails on GitHub CI. The CI log has all the details, the essential command being
git -c core.sshCommand='ssh -vvv -i repoB_deployment_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' clone -b main [email protected]:eudoxos/repoB.git repoB
The failure under Windows is Load key "repoB_deployment_key": invalid format
and I am not able to find out what's wrong. I tried changing permissions for the private key (chmod 600
), adding the -o UserKnownHostsFile=/dev/null
and -o StrictHostKeyChecking=no
, running the key through unix2dos
, adding extra trailing newline — nothing helped.
Again, the same command works under Ubuntu and under MSYS2 on desktop Windows.
The repos are publicly accessible fro reading; you are welcome to open a PR to the repoA
repository; a PR should trigger the CI run.
发布评论
评论(2)
通过dos2unix(不是 unix2dos)运行钥匙解决了问题。我将将其作为MSYS2的问题提交,因为应该记录下来。
Running the key through dos2unix (not unix2dos) fixed the issue. I will file that as an issue with msys2, as this should be documented.
在您的github工作流中尝试首先显示密钥,以便在视觉上检查其内容和格式(如在这里看到)
还要检查创建键时使用的ssh ,
c:\ program files \ openssh-win64 一个,或Windows git的一个(
c:\ program Files \ git \ usr \ usr \ bin \ ssh.exe
)。Try in your GitHub workflow to display the key first, in order to visually check its content and its format (as seen here)
Check also which SSH you used when creating the key, the
c:\Program Files\OpenSSH-Win64
one, or the one with Git for Windows (c:\Program Files\git\usr\bin\ssh.exe
).