github 当 master 获得提交时通知 nodeJS

github notification to nodeJS when master get a commit

如果我的 github 存储库中的 master 分支获得更新,我的 nodeJS 服务器收到通知,这是否可能?所以我可以用它做点什么?比如获取版本标签和提交消息?

首先您需要转到您的存储库,然后单击以下顺序:

Settings -> Webhooks & Services -> Add webhook

然后粘贴 url,其中 github 将为每个新提交提交数据。您可以在 example 中找到有效载荷的示例。

然后在后端实现处理新提交信息所需的逻辑。