gpg 私钥在 github 机密中使用时无效

发布于 2025-01-16 00:43:16 字数 621 浏览 2 评论 0原文

我目前正在尝试在 github enterprise 中设置我的 CI,其中一步涉及使用 git Secret。我想在我的 CI 中使用以下命令,

echo -e "$GPG_PRIVATE_KEY" | gpg --batch --yes --passphrase "$GPG_PASSPHRASE" --import

我在 github 的 Secrets 选项卡下创建了两个秘密 GPG_PRIVATE_KEY GPG_PASSPHRASE 并且密码也工作得很好(与其他命令)。但我无法让私钥工作。我使用了 gpg --armor --export-secret-key [email ] 的输出;protected] 但显然这不是有效的格式,因为 CI 告诉我

gpg: no valid OpenPGP data found.

可以github 不处理导出命令的格式或者我做错了什么?

I am currently trying to set up my CI in github enterprise where one step involves the usage of git secret. I'd like to use the following command in my CI

echo -e "$GPG_PRIVATE_KEY" | gpg --batch --yes --passphrase "$GPG_PASSPHRASE" --import

I created both secrets GPG_PRIVATE_KEY GPG_PASSPHRASE under the Secrets tab in github and the passphrase is also working just fine (tested with other commands). But I can't get the private key working. I used the output from gpg --armor --export-secret-key [email protected] but apparently thats not a valid format since the CI tells me

gpg: no valid OpenPGP data found.

Can github not handle the format from the export command or what am i doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文