Yikun / hub-mirror-action

一个Github Action,用于在Github和Gitee之间同步代码。Action for mirroring repos between Hubs (like Github and Gitee).
MIT License
634 stars 173 forks source link

clone_style参数设置为ssh时需要填入src_key,但未提供 #142

Closed AdoShan closed 2 years ago

AdoShan commented 2 years ago

当clone_style设置为ssh时要求提供对应的私钥,但是目前好像并没有相关的可选参数,不提供私钥会导致128错误

Yikun commented 2 years ago

@AdoShan 使用ssh方式,请把dst_key的公钥配置到源端(比如github或者gitee)就可以了。

AdoShan commented 2 years ago

@AdoShan 使用ssh方式,请把dst_key的公钥配置到源端(比如github或者gitee)就可以了。

我从GitHub同步至Gitee使用ssh的方式显示错误为github.com 访问拒绝,当前情况不是应该添加GitHub的私钥吗?

Yikun commented 2 years ago

@AdoShan dst_key的内容是私钥,dst_key的私钥对应的公钥要在github上配置。

AdoShan commented 2 years ago

@AdoShan dst_key的内容是私钥,dst_key的私钥对应的公钥要在github上配置。

配置过私钥呢

Yikun commented 2 years ago

@AdoShan 那就没问题。。。

AdoShan commented 2 years ago

@AdoShan 那就没问题。。。

但是他就是提示128错误啊,提示无权访问 Starting git clone git@github.com:AdoShan/Shan.git 97 Cmd('git') failed due to: exit code(128) 98 cmdline: git clone git@github.com:AdoShan/Shan.git /github/workspace/hub-mirror-cache/Shan 99 stderr: 'Cloning into '/github/workspace/hub-mirror-cache/Shan'... 100 git@github.com: Permission denied (publickey). 101 fatal: Could not read from remote repository. ECE7180F-B432-4855-BD35-8CCA925A3771

我需要从GitHub至Gitee,配置的是GITEE_PRIVATE_KEY(gitee对应的私钥,对应的公钥已在Gitee配置完成且密钥测试已通过)和GITEE_TOKEN,是这样吧 我用默认的https就可以,换ssh就报错了

Yikun commented 2 years ago

使用ssh方式,请把dst_key的公钥配置到源端及目的端(比如github或者gitee)就可以了。

所以,gitee对应的公钥也要在github上配置一下。

AdoShan commented 2 years ago

使用ssh方式,请把dst_key的公钥配置到源端及目的端(比如github或者gitee)就可以了。

所以,gitee对应的公钥也要在github上配置一下。

请问是配置到GitHub的SSH Keys列表吗?

Yikun commented 2 years ago

@AdoShan 是的,相当于这个ssh key有2个作用了,一个是作为从github下载的key,同时,也是作为向gitee上传的key。

Yikun commented 2 years ago

@AdoShan 问题解决了吗?有兴趣给文档中的ssh模式加个说明吗,欢迎提PR。

AdoShan commented 2 years ago

解决了。我过几天有时间提个PR上来

Sent from my iPhone

On Jan 28, 2022, at 00:17, Yikun Jiang @.***> wrote:



@AdoShanhttps://github.com/AdoShan 问题解决了吗?有兴趣给文档中的ssh模式加个说明吗,欢迎提PR。

— Reply to this email directly, view it on GitHubhttps://github.com/Yikun/hub-mirror-action/issues/142#issuecomment-1023395550, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKQ3Z6ZKNM6IYWDYXHH6D6LUYFVZPANCNFSM5LS6ZDKA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

AdoShan commented 2 years ago

已针对该问题在README.md及README_en.md中的ssh示例中添加说明并提交了PR

Sent from my iPhone

On Jan 28, 2022, at 00:17, Yikun Jiang @.***> wrote:



@AdoShanhttps://github.com/AdoShan 问题解决了吗?有兴趣给文档中的ssh模式加个说明吗,欢迎提PR。

— Reply to this email directly, view it on GitHubhttps://github.com/Yikun/hub-mirror-action/issues/142#issuecomment-1023395550, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKQ3Z6ZKNM6IYWDYXHH6D6LUYFVZPANCNFSM5LS6ZDKA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

Yikun commented 2 years ago

@AdoShan 感谢,问题我关闭了,欢迎后续遇到问题再反馈!