Git Web Hook
2016-09-13 03:07:10 0 举报
Git Web Hook是一种自动化工具,它允许你在特定的Git仓库事件发生时触发自定义的脚本或任务。这些事件可以包括代码提交、分支创建或删除等。通过设置Web Hook,你可以实现实时的代码审查、持续集成和部署等功能,提高开发团队的效率和协作能力。要使用Git Web Hook,你需要在目标仓库上配置一个HTTP服务器,并编写一个处理事件的脚本。当仓库中的事件发生时,GitHub或其他托管平台会向该服务器发送一个POST请求,触发你的脚本执行相应的操作。这样,你就可以在不手动干预的情况下,实现对代码库的自动化管理和维护。
作者其他创作
大纲/内容
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 条评论
下一页