Git Web Hook
2016-09-13 03:07:10 0 举报
Git Web Hook 是一种自动化工具,用于在特定的 Git 仓库事件(如提交、推送等)发生时触发自定义的 HTTP 请求。通过设置 Web Hook,您可以实现对代码仓库的实时监控和自动化处理,例如自动部署、构建、测试等。Web Hook 可以通过多种方式实现,如使用第三方服务或自己搭建服务器。要使用 Web Hook,您需要在目标仓库的设置中添加一个回调 URL,该 URL 将接收到来自 Git 的事件数据。这样,当有新的提交或推送事件发生时,您的服务器就可以自动执行相应的操作,从而实现代码仓库的自动化管理。
作者其他创作
大纲/内容
Git login page
Step4: Create Webhook for certain repository
Success
Callback url: GitHub will redirect users to the callback URL configured here if user doesn't provide another redirect url in the api that requests GitHub access.
Yes
Step 0: Register a new OAuth Application
Customer Http Server
Call self-defined API
Step6: For other operation...
Send code to the server side
Step1: OAuth
(The access token allows you to make requests to the API on a behalf of a user)
Customer Web front pages
Customer Http ServerPOST: https://github.com/login/oauth/access_token
Just call GitHub api with access token.GitHub API: https://developer.github.com/v3/
Step2: GET access token
Step5: Create A POST function in server side to listen all messages from GitHub
Customer Http ServerGET /user/reposTips: add access token you get in step2 as a prameter
0 条评论
下一页