收到定义的评论时发送 webhook 请求

Send a webhook request when a defined comment is received

我的问题很简单:只有当从推送中收到的提交消息等于我们已经定义的短语时,是否有一种方法可以激活 webhook。

示例:假设我的消息信号是 "Launch me"

如果我执行以下操作:

git commit -m "Imported Something"
git push origin master

那就什么都不会发生了。但是:

git commit -m "Launch me"
git push origin master

然后 webhook 将启动并将信号发送到配置的地址。

谢谢。

您实际上可以使用一种叫做 git 挂钩的东西来拒绝基于 commit-message 短语的 commit/push 并且基于该 webhook 将在配置为调用时自动触发用于推送事件。 请参考这个 link https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks