gpt4 book ai didi

How do I fix "base64: invalid input" error in github workflow publish (gpg)?(如何修复GitHub工作流发布(Gpg)中的“Base64:无效输入”错误?)

转载 作者:bug小助手 更新时间:2023-10-24 21:44:19 34 4
gpt4 key购买 nike



I'm running a github workflow I've used many times in the past to publish code to nexus. It is failing now. I haven't used it in a while, so it's possible my original key expired...been >3 yrs since I created it and I can't remember if I set it to expire or not.

我运行的是GitHub工作流,过去我曾多次使用该工作流将代码发布到Nexus.它现在正在失败。我已经有一段时间没有使用它了,所以我的原始密钥可能已经过期了……自从我创建它以来,已经超过3年了,我不记得我是否设置了它过期。


I generated a new rsa key with gpg and default length (about 3K I think), published it to keyserver.ubuntu.com, and pasted it into my secret variable PGP_SECRET in my project's github repo, which my gpg command uses.

我生成了一个具有gpg和默认长度(我认为大约3K)的新rsa密钥,将其发布到keyserver.ubuntu.com,并将其粘贴到我的项目的GitHub repo中的秘密变量PGP_SECRET中,我的gpg命令使用该变量。


I run my workflow with the gpg command in it, and get this error:

我使用其中的gpg命令运行我的工作流,并收到以下错误:


Running ci-release.
branch=refs/tags/v1.2.2
gpg (GnuPG) 2.2.27
java.lang.RuntimeException: base64: invalid input
...
[error] base64: invalid input
[error] Use 'last' for the full log.

Error: Process completed with exit code 1.


What is this error, and how can I fix it? Does this mean my RSA key is bad/unrecognized by github?

这个错误是什么,我如何修复它?这是否意味着我的RSA密钥已损坏/无法被GitHub识别?


(I'll add that I can successfully encrypt/decript with my key locally using gpg.)

(我要补充的是,我可以使用gpg在本地使用我的密钥成功地加密/解密。)


更多回答
优秀答案推荐

Found out the missing piece--need to convert to base64.

找到了丢失的部分--需要转换到Base64。


Steps:

步骤:


1. gpg --full-generate-key   (answer all promopts--remember passphrase)
-> Choose RSA, default length
2. gpg --keyserver keyserver.ubuntu.com --send-keys <key_id> (publish key to the world)
3. gpg --armor --export-secret-keys <key_id> | base64
4. cut/paste this ascii block into wherever it will be use, e.g. github secret var

更多回答

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com