github cli- grep用于通过拉动请求主体中的短语过滤?

发布于 2025-01-22 05:08:11 字数 329 浏览 4 评论 0原文

我正在使用GitHub CLI工具,其中包括一个命令GH PR列表,该工具可让您查看所有打开的拉请请求。

问题是我只看到他们的标题列表,并且有一个单独的命令gh pr视图[额外信息]实际上允许您查看body

我正在搜索身体中具有一定短语的拉请请求,因此gh pr列表| GREP“ Hello”是行不通的,因为它只会在标题中使用“ Hello”提供拉动请求,而不一定是主体。

我将如何解决这个问题,而Github CLI中是否有任何可能对我有帮助的捷径?

I’m using the Github CLI tool, which includes a command gh pr list that allows you to see all the open pull requests.

The issue is that I only see a list of their titles and there’s a separate command gh pr view [extra info] that actually allows you to see the body.

I’m searching for pull requests that have a certain phrase in the BODY so gh pr list | grep “hello” wouldn’t work because it only gives me pull requests with “hello” in the header, and not necessarily the body.

How might I go about approaching this problem and are there any shortcuts in the github cli that might help me?

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

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

发布评论

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

评论(1

苦妄 2025-01-29 05:08:11

sicne gh pr List,例如 gh pr view ,确实从相同的选项-json< fields> gt;(带有指定字段的输出JSON),您可以使用:

gh pr list --json number,body | grep "helllo"

这将为您的特定消息抓取,并且仍然可以为您提供一个可以与gh pr View一起使用的ID。

Sicne gh pr list, like gh pr view, does inherit from the same option --json <fields> (Output JSON with the specified fields), you can use:

gh pr list --json number,body | grep "helllo"

That would grep for your specific message, and still give you an ID that you can use with gh pr view.

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