Post 对 Github 通过命令行拉取请求的评论
Post a comment on Github Pull Request via Command Line
有没有办法可以通过命令行 post 对 Github 拉取请求发表评论?我的想法是,我希望 Jenkins post 对 Pull Requests 的评论和脚本结果的总结。
没有第三方扩展是不可能的。
您可能对此感兴趣:https://github.com/stephencelis/ghi
抱歉,我帮不上忙了!
这完全可以通过 curl 实现。
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!"}'
在此处阅读有关 API 的更多信息 https://docs.github.com/en/rest/reference/issues#create-an-issue-comment
注意: 这假设您有一个个人访问令牌存储在名为 GITHUB_TOKEN
的环境变量中
有没有办法可以通过命令行 post 对 Github 拉取请求发表评论?我的想法是,我希望 Jenkins post 对 Pull Requests 的评论和脚本结果的总结。
没有第三方扩展是不可能的。
您可能对此感兴趣:https://github.com/stephencelis/ghi
抱歉,我帮不上忙了!
这完全可以通过 curl 实现。
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!"}'
在此处阅读有关 API 的更多信息 https://docs.github.com/en/rest/reference/issues#create-an-issue-comment
注意: 这假设您有一个个人访问令牌存储在名为 GITHUB_TOKEN