зеркало из https://github.com/github/docs.git
Move webhook info out of the get started docs (#37458)
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
This commit is contained in:
Родитель
d515311e39
Коммит
716656c400
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
title: About webhooks
|
||||
redirect_from:
|
||||
- /post-receive-hooks
|
||||
- /articles/post-receive-hooks
|
||||
- /articles/creating-webhooks
|
||||
- /articles/about-webhooks
|
||||
- /github/extending-github/about-webhooks
|
||||
- /get-started/customizing-your-github-workflow/exploring-integrations/about-webhooks
|
||||
intro: Webhooks provide a way for notifications to be delivered to an external web server whenever certain actions occur on a repository or organization.
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
---
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip:** {% data reusables.organizations.owners-and-admins-can %} manage webhooks for an organization. {% data reusables.organizations.new-org-permissions-more-info %}
|
||||
|
||||
{% endtip %}
|
||||
|
||||
Webhooks can be triggered whenever a variety of actions are performed on a repository or an organization. For example, you can configure a webhook to execute whenever:
|
||||
|
||||
* A repository is pushed to
|
||||
* A pull request is opened
|
||||
* A {% data variables.product.prodname_pages %} site is built
|
||||
* A new member is added to a team
|
||||
|
||||
Using the {% ifversion fpt or ghec %}{% data variables.product.prodname_dotcom %}{% else %}{% data variables.product.product_name %}{% endif %} API, you can make these webhooks update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server.
|
||||
|
||||
To set up a new webhook, you'll need access to an external server and familiarity with the technical procedures involved. For help on building a webhook, including a full list of actions you can associate with, see "[AUTOTITLE](/webhooks-and-events/webhooks/about-webhooks)."
|
|
@ -15,7 +15,6 @@ versions:
|
|||
ghes: '*'
|
||||
children:
|
||||
- /about-integrations
|
||||
- /about-webhooks
|
||||
- /about-github-marketplace
|
||||
- /github-extensions-and-integrations
|
||||
- /github-developer-program
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
---
|
||||
title: About webhooks
|
||||
intro: Learn the basics of how webhooks work to help you build and set up integrations.
|
||||
intro: Webhooks provide a way for notifications to be delivered to an external web server whenever certain events occur on {% data variables.product.company_short %}.
|
||||
redirect_from:
|
||||
- /webhooks
|
||||
- /developers/webhooks-and-events/about-webhooks
|
||||
- /developers/webhooks-and-events/webhooks/about-webhooks
|
||||
- /get-started/exploring-integrations/about-webhooks
|
||||
- /post-receive-hooks
|
||||
- /articles/post-receive-hooks
|
||||
- /articles/creating-webhooks
|
||||
- /articles/about-webhooks
|
||||
- /github/extending-github/about-webhooks
|
||||
- /get-started/customizing-your-github-workflow/exploring-integrations/about-webhooks
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
|
@ -14,27 +21,21 @@ topics:
|
|||
- Webhooks
|
||||
---
|
||||
|
||||
{% data reusables.webhooks.webhooks-ipv6 %}
|
||||
Webhooks can be triggered whenever specific events occur on {% data variables.product.company_short %}. For example, you can configure a webhook to trigger whenever:
|
||||
|
||||
Webhooks allow you to build or set up integrations, such as [{% data variables.product.prodname_github_apps %}](/apps/creating-github-apps/setting-up-a-github-app) or [{% data variables.product.prodname_oauth_apps %}](/apps/oauth-apps/building-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.
|
||||
* Code is pushed to a repository
|
||||
* A pull request is opened
|
||||
* A {% data variables.product.prodname_pages %} site is built
|
||||
* A new member is added to a team
|
||||
|
||||
Webhooks can be installed on{% ifversion ghes or ghae %} [{% data variables.product.prodname_enterprise %}](/rest/enterprise-admin#global-webhooks/),{% endif %} an [organization][org-hooks], a specific [repository][repo-hooks], or a {% data variables.product.prodname_github_app %}. Once installed, the webhook will be sent each time one or more subscribed events occurs.
|
||||
You can add webhooks to{% ifversion ghes or ghae %} {% data variables.product.prodname_enterprise %},{% endif %} an organization, a repository, or a {% data variables.product.prodname_github_app %}.
|
||||
|
||||
When you add a webhook, you choose which events you want to subscribe to. To limit the number of HTTP requests to your server, you should only subscribe to the specific events that you plan on handling. By default, webhooks installed on {% ifversion ghes or ghae %} {% data variables.product.prodname_enterprise %},{% endif %} an organization or a repository are only subscribed to the push event. By default, webhooks on {% data variables.product.prodname_github_app %}s are not subscribed to any events. You can change the events that a webhook is subscribed to at any time. For a complete list of webhook events, see "[AUTOTITLE](/webhooks-and-events/webhooks/webhook-events-and-payloads)."
|
||||
|
||||
You typically need a server to receive webhooks events. When you add a webhook, you specify a URL where you want to receive the webhook events. {% data variables.product.company_short %} will send a HTTP POST payload to this URL when any events that the webhook is subscribed to occur.
|
||||
|
||||
When your server receives a webhook event, it can process and respond to the webhook. For example, code running on your server could update an external issue tracker, trigger CI builds, update a backup mirror, or deploy to a production server when it receives a webhook event.
|
||||
|
||||
You can create up to {% ifversion ghes or ghae %}250{% else %}20{% endif %} webhooks for each event on each installation target {% ifversion ghes or ghae %}({% data variables.product.prodname_ghe_server %} instance, specific organization, or specific repository).{% else %}(specific organization or specific repository).{% endif %}
|
||||
|
||||
## Events
|
||||
|
||||
{% data reusables.webhooks.webhooks_intro %}
|
||||
|
||||
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 "[AUTOTITLE](/webhooks-and-events/webhooks/webhook-events-and-payloads)."
|
||||
|
||||
## Ping event
|
||||
|
||||
{% data reusables.webhooks.ping_short_desc %}
|
||||
|
||||
For more information about the `ping` event webhook payload, see the [`ping`](/webhooks-and-events/webhooks/webhook-events-and-payloads#ping) event.
|
||||
|
||||
[org-hooks]: /rest/orgs#webhooks/
|
||||
[repo-hooks]: /rest/repos#webhooks
|
||||
{% data reusables.webhooks.webhooks-ipv6 %}
|
||||
|
|
|
@ -48,6 +48,8 @@ Make a note of the `*.ngrok.io` URL. We'll use it to set up our webhook.
|
|||
|
||||
You can install webhooks on an organization or on a specific repository.
|
||||
|
||||
{% data reusables.organizations.owners-and-admins-can %} manage webhooks for an organization. {% data reusables.organizations.new-org-permissions-more-info %}
|
||||
|
||||
To set up a webhook, go to the settings page of your repository or organization. From there, click **Webhooks**, then **Add webhook**.
|
||||
|
||||
Alternatively, you can choose to build and manage a webhook [through the Webhooks API][webhook-api].
|
||||
|
@ -97,3 +99,9 @@ To configure a webhook for all events, use the wildcard (`*`) character to speci
|
|||
[webhooks-overview]: /webhooks-and-events/webhooks/about-webhooks
|
||||
[webhook-api]: /rest/repos#hooks
|
||||
[hooks-api]: /webhooks-and-events/webhooks/about-webhooks#events
|
||||
|
||||
### Ping event
|
||||
|
||||
{% data reusables.webhooks.ping_short_desc %}
|
||||
|
||||
For more information about the `ping` event webhook payload, see the [`ping`](/webhooks-and-events/webhooks/webhook-events-and-payloads#ping) event.
|
||||
|
|
|
@ -1 +1 @@
|
|||
When configuring a webhook, you can use the UI or API to choose which events will send you payloads. Only subscribing to the specific events you plan on handling limits the number of HTTP requests to your server. You can also subscribe to all current and future events. By default, webhooks are only subscribed to the push event. You can change the list of subscribed events anytime.
|
||||
When configuring a webhook, you can choose which events will send you payloads. To limit the number of HTTP requests to your server, you should only subscribe to the specific events that you plan on handling. By default, webhooks installed on {% ifversion ghes or ghae %} [{% data variables.product.prodname_enterprise %}](/rest/enterprise-admin#global-webhooks/),{% endif %} an [organization][org-hooks], or a [repository][repo-hooks] are only subscribed to the push event. By default, webhooks on {% data variables.product.prodname_github_app %}s are not subscribed to any events. You can change events that a webhook is subscribed to at any time.
|
||||
|
|
Загрузка…
Ссылка в новой задаче