Github拉取请求检查 [英] Github Pull Request Checks

查看:96
本文介绍了Github拉取请求检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为请求请求创建Github Check?我知道有WebHooks,但是有没有办法也可以钩入UI?

Is it possible to create a Github Check for pull requests? I know there are WebHooks, but is there a way to also hook into the UI?

目标:

  • 提出了请求.执行验证并更新拉取请求(如果有效).

  • Pull Request made. Perform validation and update pull request if valid.

合并请求合并.创建对URL的Web调用.确认更新Github问题.

Pull Request merged. Create web call to URL. Update Github issue with confirmation.

执行此操作的最佳方法是什么?是否仅通过Web Hook,API调用和获取写入的oAuth凭证?

What's the best way to do this? Is it only via Web Hooks, API calls and getting write oAuth credentials?

推荐答案

我知道有WebHooks,但是有没有办法也可以钩入UI?

I know there are WebHooks, but is there a way to also hook into the UI?

推荐的方法是将必需的状态检查和Status API与Webhooks结合使用:

The recommended way of doing this is to use required status checks and the Status API, in combination with webhooks:

https://help.github.com/articles/about-required -status-checks/

https://developer.github.com/v3/repos/statuses/

用户在存储库上设置必需的状态检查,以便在特定状态不是success时阻止合并拉取请求.

Users set up required status checks on the repository so that merging a pull request is blocked if a specific status isn't success.

同时,当请求请求更新时,webhooks会触发一个外部进程,并且该进程根据该进程的输出创建状态.如果该过程成功完成,则该过程应创建一个success状态,该状态将显示在UI中并取消阻止合并拉取请求.

At the same time, webhooks trigger an external process when a pull request is updated, and that process creates statuses based on the output of that process. If the process completes successfully, then the process should create a success status which will be shown in the UI and unblock the merging of the pull request.

是否仅通过Web挂钩,API调用和获取写入的oAuth凭证?

Is it only via Web Hooks, API calls and getting write oAuth credentials?

为了创建状态,您确实确实需要使用具有推送访问存储库权限的用户的凭据进行身份验证(例如,通过具有正确

In order to create statuses, you will indeed need to authenticate with the credentials of a user that has push access to the repository (e.g. via a token from that user with the right scopes).

这篇关于Github拉取请求检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆