git 验证可信标签

发布于 2024-12-13 11:03:02 字数 151 浏览 7 评论 0原文

我想将 git tag -v 命令包含到部署过程中,以捕获未签名的标签或由不受信任的 GPG 密钥签名的标签。

如果标签具有有效签名,则该命令将返回退出代码 0,但不关心签名密钥是否可信。

我不想手动 grep 结果 GPG 消息

I would like to include git tag -v command into the deployment process to catch unsigned tags or tags signed by a non-trusted GPG key.

The command returns with an exit code of 0 if the tag has a valid signature, but does not care wether the signed key is trusted or not.

I don't want to resort to grepping the resulting GPG message manually

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一抹淡然 2024-12-20 11:03:02

我还没有尝试过,文档没有提到退出代码,但你可以尝试

git-verify-tag 管道命令


更新 由于没有简单的方法来测试它,我回顾了源代码:

https://github.com/git/git/blob/81b50f3ce40bfdd66e5d967bf82be001039a9a98/builtin/verify-tag.c

它似乎有意识地返回相关的结果代码,所以我期望这个去工作

I haven't tried it yet, and the documentation doesn't mention exit codes, but you could try

git-verify-tag plumbing command


Update Having no easy way to test this, I've reviewed the source code:

https://github.com/git/git/blob/81b50f3ce40bfdd66e5d967bf82be001039a9a98/builtin/verify-tag.c

It does appear to consciously return the relevant result codes, so I'd expect this to work

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文