如何解决Julia 文档“加载密钥:格式无效”
我按照托管文档 (Documenter.jl) 部署了 TSSOS Julia 包的文档。但是我在工作流程中遇到以下错误(GitHub Actions):
Failed to add the RSA host key for IP address '140.82.112.3' to the list of known hosts (/home/runner/.ssh/known_hosts).
Load key "/home/runner/work/TSSOS/TSSOS/docs/.documenter": invalid format
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
┌ Error: Git failed to fetch git@github.com:wangjie212/TSSOS.git
│ This can be caused by a DOCUMENTER_KEY variable that is not correctly set up.
│ Make sure that the environment variable is properly set up as a Base64-encoded string
│ of the SSH private key. You may need to re-generate the keys with DocumenterTools.
└ @ Documenter ~/.julia/packages/Documenter/FuXcO/src/Documenter.jl:554
有解决这个问题的想法吗?我使用的是 Windows 10 系统,密钥对是由 DocumenterTools.genkeys
生成的。
解决方法
啊,看来是用错了存放机密的地方。当您输入机密时,有两个选项:环境机密和存储库机密。在新的 github 界面中,很难找到可以添加存储库机密的位置,但仍然有可能。它位于 settings/secrets
中,您必须先创建一个环境。创建环境后,您应该再次点击secrets
,界面中间有一个几乎不可见的按钮“New repository secret”。您应该将 DOCUMENTER_KEY
放在那里,一切都会顺利进行。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。