Skip to content

Commit 6bc39ab

Browse files
authored
Merge pull request github#28381 from github/repo-sync
Repo sync
2 parents bbb6f04 + ec447f8 commit 6bc39ab

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

content/webhooks/testing-and-troubleshooting-webhooks/redelivering-webhooks.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ topics:
1212

1313
## About redelivering webhooks
1414

15-
You may want to redeliver a webhook to help you test your application or to recover from server downtime. You can redeliver webhook deliveries that occurred in the past 30 days.
15+
You may want to redeliver a webhook to help you test your application or to recover from server downtime. You can redeliver webhook deliveries that occurred in the past 30 days. {% data variables.product.company_short %} does not automatically redeliver failed deliveries.
1616

1717
## Redelivering repository webhooks
1818

@@ -91,8 +91,6 @@ Only the owner of the sponsored account can redeliver sponsorship webhooks for t
9191

9292
Only enterprise owners can redeliver webhooks in that enterprise.
9393

94-
{% ifversion ghes or ghae %}You can use the {% data variables.product.company_short %} web interface or the REST API to redeliver global webhooks. For more information about using the REST API to redeliver webhooks, see "[AUTOTITLE](/rest/enterprise-admin/global-webhooks)."{% endif %}
95-
9694
{% data reusables.enterprise-accounts.access-enterprise %}
9795
{% data reusables.enterprise-accounts.settings-tab %}
9896
{% data reusables.enterprise-accounts.hooks-tab %}

content/webhooks/testing-and-troubleshooting-webhooks/viewing-webhook-deliveries.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ Only the owner of the sponsored account can view deliveries for sponsorship webh
9393

9494
Only enterprise owners can view deliveries for webhooks in that enterprise.
9595

96-
{% ifversion ghes or ghae %}You can use the {% data variables.product.company_short %} web interface or the REST API to view recent deliveries for global webhooks. For more information about using the REST API to view recent deliveries, see "[AUTOTITLE](/rest/enterprise-admin/global-webhooks)."{% endif %}
97-
9896
{% data reusables.enterprise-accounts.access-enterprise %}
9997
{% data reusables.enterprise-accounts.settings-tab %}
10098
{% data reusables.enterprise-accounts.hooks-tab %}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Handling failed webhook deliveries
3+
shortTitle: Handling failed deliveries
4+
intro: '{% data variables.product.company_short %} does not automatically redeliver failed webhook deliveries, but you can handle failed deliveries manually or by writing code.'
5+
versions:
6+
fpt: '*'
7+
ghes: '*'
8+
ghae: '*'
9+
ghec: '*'
10+
topics:
11+
- Webhooks
12+
---
13+
14+
## About webhook delivery failures
15+
16+
A webhook delivery can fail for multiple reasons. For example, if your server is down or takes longer than {% ifversion fpt or ghec %}10{% else %}30{% endif %} seconds to respond, {% data variables.product.company_short %} will record the delivery as a failure.
17+
18+
{% data variables.product.company_short %} does not automatically redeliver failed deliveries.
19+
20+
## Handling delivery failures
21+
22+
You can manually redeliver failed deliveries. For more information, see "[AUTOTITLE](/webhooks/testing-and-troubleshooting-webhooks/redelivering-webhooks)."
23+
24+
You can also write a script that checks for failed deliveries and attempts to redeliver any that failed. Your script should run on a schedule and do the following:
25+
26+
- Use the {% data variables.product.company_short %} REST API to fetch data about any webhook deliveries that were attempted since the last time that your script ran. For more information, see "[AUTOTITLE](/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook)," "[AUTOTITLE](/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook)," and "[AUTOTITLE](/rest/apps/webhooks#list-deliveries-for-an-app-webhook)."
27+
28+
{% ifversion fpt %}There are no API endpoints to get data about {% data variables.product.prodname_marketplace %} webhooks or {% data variables.product.prodname_sponsors %} webhooks.{% endif %}{% ifversion ghec %}There are no API endpoints to get data about {% data variables.product.prodname_marketplace %} webhooks, {% data variables.product.prodname_sponsors %} webhooks, or global webhooks.{% endif %}{% ifversion ghes or ghae %}There are no API endpoints to get data about global webhook deliveries.{% endif %}
29+
30+
- Look at the fetched data to see if any deliveries failed. The data for a failed delivery will have a `status` value that is not `OK`.
31+
- Use the {% data variables.product.company_short %} REST API to redeliver any deliveries that failed. For more information, see "[AUTOTITLE](/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook)," "[AUTOTITLE](/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook)," and "[AUTOTITLE](/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook)."
32+
33+
If a webhook delivery fails repeatedly, you should investigate the cause. Each failed delivery will give a reason for failure. For example, if the delivery failure indicates that {% data variables.product.company_short %} couldn't connect to the host, you should verify that the domain portion of the webhook URL that you specified resolves to an IP address.

content/webhooks/using-webhooks/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ children:
1212
- /creating-webhooks
1313
- /handling-webhook-deliveries
1414
- /securing-your-webhooks
15+
- /handling-failed-webhook-deliveries
1516
- /disabling-webhooks
1617
- /best-practices-for-using-webhooks
1718
---

0 commit comments

Comments
 (0)