Directory
- The configuration of webhooks in GitHub
- Testing the configuration of the Webhooks
Currently in the team designing an application management feature, you need to understand the use of common code-managed webhooks. Webhooks, the first of GitHub, took the lead, and recorded the use of webhooks in GitHub below.
The configuration of webhooks in GitHub
在自己的GitHub的项目中选中settings按钮,进入到webhooks的配置界面,然后选择左侧栏的webhooks进行配置。详细的参数配置属性值,可以查看官方的文档https://developer.github.com/webhooks/,当然,基础的配置我们一眼就看出来了,不看文档也行,嘻嘻。。。
After the configuration is displayed a callback address, you can see that the push in the back of the slogan for we just selected the push code when the callback, the URL of the callback can also be edited and deleted
Testing the configuration of the Webhooks
由于我选择的是push代码的时候才进行回调,所以我们在自己的项目中提交一个commit,来看看webhooks回调我们的URL时给出的数据格式是什么。提交一个commit后,我再次进入Settings->Webhooks 最下方有我们刚才出发的回调
点击上面的最近的一次提交,我们可以看到请求头信息,和响应信息在请求的参数中,我们可以拿到好多有用的信息,比如提交人的名字,邮箱,修改的文件,上次提交的ID,代码库的创始人,邮箱等等有用的信息
Use of webhooks in GitHub