Skip to main content
我们经常发布文档更新,此页面的翻译可能仍在进行中。 有关最新信息,请访问英语文档

About webhooks

本文内容

Learn the basics of how webhooks work to help you build and set up integrations.

注意:GitHub Webhook 目前不支持 IPv6,但将来会支持 IPv6。 /meta REST API 终结点返回 IPv6 范围以启用该转换。

Webhooks allow you to build or set up integrations, such as GitHub Apps or OAuth Apps, which subscribe to certain events on GitHub.com. When one of those events is triggered, we'll send a HTTP POST payload to the webhook's configured URL. Webhooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server. You're only limited by your imagination.

Webhooks can be installed on GitHub Enterprise, an organization, a specific repository, or a GitHub App. Once installed, the webhook will be sent each time one or more subscribed events occurs.

You can create up to 250 webhooks for each event on each installation target (GitHub Enterprise Server instance, specific organization, or specific repository).

Events

配置 web 挂钩时,您可以使用 UI 或 API 选择哪些事件将向您发送有效负载。 仅订阅您计划处理的特定事件可限制对服务器的 HTTP 请求数。 您也可以订阅所有当前和未来的事件。 默认情况下,web 挂钩只订阅推送事件。 您可以随时更改订阅事件的列表。

Each event corresponds to a certain set of actions that can happen to your organization and/or repository. For example, if you subscribe to the issues event you'll receive detailed payloads every time an issue is opened, closed, labeled, etc.

For a complete list of available webhook events and their payloads, see "Webhook 事件和有效负载."

Ping event

当你创建新的 Webhook 时,我们将向你发送一个简单的 ping 事件,让你知道你已正确设置 Webhook。 此事件不会存储,因此无法通过事件 API 终结点进行检索。

For more information about the ping event webhook payload, see the ping event.