问题描述
我需要你的帮助!
当项目成员提交新版本时,如何使用git hook api下载github项目中的更新文件(不是所有文件)?
How to download the updated files in github project (not all files) using git hook api when project members commiting the new version ?
推荐答案
该想法是注册一个Webhook 作为您的存储库,它将发出一个 JSON有效载荷,您可以监听. br>您可以为 webhook . v3/activity/events/types/#pushevent"rel =" nofollow noreferrer>推送事件
The idea is to register a webhook for your repo, which will emit a JSON payload that you would listen.
You can register a webhook for push event
侦听器取决于您的本地环境.
例如,您有介绍Gith-Node的GitHub WebHooks ,可以按有效负载类型过滤有效负载:存储库,分支,文件或标签
The listener depends on your local environment.
For example, you have Introducing Gith - GitHub WebHooks For Node, which can filter the payloads by payload type: repository, branch, file or tag
对于python中的实例,您可以使用更简单的侦听器..
同样,侦听器的详细信息以及收到消息后的操作(例如git pull
以下载已更改的内容)取决于您的特定环境.
You have simpler listeners, for instance on in python.
Again, the specifics of the listener and what you can do when you receive the message (like a git pull
to download what has changed) depend on your particular environment.
这篇关于如何使用Github Webhooks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!