gh命令行获取评论的git hash提交

发布于 2025-01-18 05:12:35 字数 398 浏览 3 评论 0原文

如何获取与项目提交哈希相关的 github 评论?

假设我们有这个 github 提交 https://github.com/actions/checkout/commit/5126516654c75f76bca1de45dd82a3006d8890f9

如何使用命令行 gh 命令获取其评论? Github 命令行? https://github.com/cli/cli

How to fetch the github comment associated with the commit hash on a project?

Lets say we have this github commit
https://github.com/actions/checkout/commit/5126516654c75f76bca1de45dd82a3006d8890f9

How to fetch its comments using command line gh command? Github cli?
https://github.com/cli/cli

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

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

发布评论

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

评论(1

只有影子陪我不离不弃 2025-01-25 05:12:35

我刚刚尝试了 gh api 方法,使用 获取提交 API

get /repos/{owner}/{repo}/commits/{ref}
gh api repos/actions/checkout/commits/5126516654c75f76bca1de45dd82a3006d8890f9 \
       --jq ".commit.message"

结果:

Bump minimist from 1.2.5 to 1.2.6 (#741)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

I just tried the gh api approach, using the get commit API:

get /repos/{owner}/{repo}/commits/{ref}
gh api repos/actions/checkout/commits/5126516654c75f76bca1de45dd82a3006d8890f9 \
       --jq ".commit.message"

Result:

Bump minimist from 1.2.5 to 1.2.6 (#741)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文