简体   繁体   English

从 Github 获取拉取请求的审查状态

[英]Get review status of pull request from Github

Running on GitHub Enterprise I have a small Jenkins job that looks for pull-request comments and triggers a script depending on the message.在 GitHub Enterprise 上运行我有一个小型 Jenkins 作业,用于查找拉取请求评论并根据消息触发脚本。

Now I only want to trigger the script if review is already done from GitHub point of view, like all CODE_OWNERS and no additional person requested changes.现在我只想在从 GitHub 的角度审查已经完成的情况下触发脚本,就像所有 CODE_OWNERS 并且没有其他人请求更改。 I don't want to implement that logic myself.我不想自己实现那个逻辑。 GitHub has different section for reviews and status checks. GitHub 有不同的部分用于评论和状态检查。 I only want review state, since I am going to set the status myself.我只想要审查状态,因为我要自己设置状态。

But I was not able to the correct value from the API endpoint.但是我无法从 API 端点获得正确的值。 Neither from pull-request itself, nor from pulls/id/reviews.既不是来自 pull-request 本身,也不是来自 pulls/id/reviews。 Closest that i found was "mergeable_state", but this unfortunately takes the status check into consideration.我发现最接近的是“mergeable_state”,但不幸的是,这考虑了状态检查。

Is there another place to look for?还有其他地方可以寻找吗?

I don't think you can fetch the global review status.我认为您无法获取全球审核状态。 I think that the best you can do is to check that there are no review requests and fetch all reviews to check if there are no requested changes.我认为您能做的最好的事情就是检查是否没有审核请求并获取所有 评论以检查是否没有请求的更改。

最后我们决定在 Github 中制作一个 Probot 应用程序,它能够获取所有必需的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM