通过命令行发表对Github Pull Request的评论

时间:2016-12-17 21:48:42

标签: github command-line-interface pull-request

有没有办法可以通过命令行在Github Pull Request上发表评论?我的想法是,我希望Jenkins发布有关Pull Requests的评论,并附上脚本结果的摘要。

2 个答案:

答案 0 :(得分:1)

如果没有第三方扩展,这是不可能的。

您可能对此感兴趣:https://github.com/stephencelis/ghi

抱歉,我帮不了多忙!

答案 1 :(得分:1)

这完全是可能的,只是卷曲。

curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  https://api.github.com/repos/octocat/hello-world/issues/42/comments \
  -d '{"body":"Hello Github!"}'

https://docs.github.com/en/rest/reference/issues#create-an-issue-comment

上了解有关正在使用的API的更多信息。

注意::这假设您在名为GITHUB_TOKEN的环境变量中存储了个人访问令牌

相关问题