gh 命令行通过哈希获取 git 提交的评论
gh command line fetch the comment for a git commit by its hash
如何获取与项目上的提交散列关联的 github 评论?
假设我们有这个 github 提交
https://github.com/actions/checkout/commit/5126516654c75f76bca1de45dd82a3006d8890f9
如何使用命令行gh命令获取其评论? Github 客户端?
https://github.com/cli/cli
我刚试过 gh api
approach, using the get commit 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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
如何获取与项目上的提交散列关联的 github 评论?
假设我们有这个 github 提交 https://github.com/actions/checkout/commit/5126516654c75f76bca1de45dd82a3006d8890f9
如何使用命令行gh命令获取其评论? Github 客户端? https://github.com/cli/cli
我刚试过 gh api
approach, using the get commit 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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>