@@ -37,6 +37,12 @@ To compare tags, you can select a tag name from the `compare` drop-down menu at
|
||||
|
||||
Here's an example of a [comparison between two tags](https://github.com/octocat/linguist/compare/v2.2.0...octocat:v2.3.3).
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** If a branch and a tag have the same name, the branch will be used when comparing commits. You can compare the tag specifically by adding `tags/` to the tag name.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## Comparing commits
|
||||
|
||||
You can also compare two arbitrary commits in your repository or its forks on {% data variables.product.prodname_dotcom %} in a two-dot diff comparison.
|
||||
|
||||
@@ -17,6 +17,6 @@ autogenerated: rest
|
||||
|
||||
## About webhooks for {% data variables.product.prodname_github_apps %}
|
||||
|
||||
A {% data variables.product.prodname_github_app %}'s webhook allows you to receive HTTP `POST` payloads whenever certain events happen for an app. {% data reusables.webhooks.webhooks-rest-api-links %}
|
||||
A {% data variables.product.prodname_github_app %}'s webhook allows your server to receive HTTP `POST` payloads whenever certain events happen for a {% data variables.product.prodname_github_app %}. For more information, see "[AUTOTITLE](/webhooks)" and "[AUTOTITLE](/apps/creating-github-apps/registering-a-github-app/using-webhooks-with-github-apps)."
|
||||
|
||||
<!-- Content after this section is automatically generated -->
|
||||
|
||||
@@ -15,25 +15,15 @@ autogenerated: rest
|
||||
|
||||
## About organization webhooks
|
||||
|
||||
Organization webhooks allow you to receive HTTP `POST` payloads whenever certain events happen in an organization. For more information, see "[AUTOTITLE](/webhooks-and-events/webhooks/about-webhooks)."
|
||||
Organization webhooks allow your server to receive HTTP `POST` payloads whenever certain events happen in an organization. For more information, see "[AUTOTITLE](/webhooks)."
|
||||
|
||||
### Scopes and restrictions
|
||||
|
||||
All actions against organization webhooks require the authenticated user to be an admin of the organization being managed. Additionally, OAuth tokens require the `admin:org_hook` scope. For more information, see "[AUTOTITLE](/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps)."
|
||||
You must be an organization owner to use these endpoints. OAuth tokens require the `admin:org_hook` scope to use these endpoints.
|
||||
|
||||
In order to protect sensitive data which may be present in webhook configurations, we also enforce the following access control rules:
|
||||
|
||||
- {% data variables.product.prodname_oauth_apps %} cannot list, view, or edit webhooks which they did not create.
|
||||
- Users cannot list, view, or edit webhooks which were created by {% data variables.product.prodname_oauth_apps %}.
|
||||
|
||||
### Receiving Webhooks
|
||||
|
||||
In order for {% data variables.product.product_name %} to send webhook payloads, your server needs to be accessible from the Internet. We also highly suggest using SSL so that we can send encrypted payloads over HTTPS.
|
||||
|
||||
For more best practices, [see our guide](/rest/guides/best-practices-for-integrators).
|
||||
|
||||
#### Webhook headers
|
||||
|
||||
{% data variables.product.product_name %} will send along several HTTP headers to differentiate between event types and payload identifiers. See [webhook headers](/webhooks-and-events/webhooks/webhook-events-and-payloads#delivery-headers) for details.
|
||||
|
||||
<!-- Content after this section is automatically generated -->
|
||||
|
||||
@@ -18,4 +18,8 @@ redirect_from:
|
||||
autogenerated: rest
|
||||
---
|
||||
|
||||
## About repository webhooks
|
||||
|
||||
Repository webhooks allow your server to receive HTTP `POST` payloads whenever certain events happen in a repository. For more information, see "[AUTOTITLE](/webhooks)."
|
||||
|
||||
<!-- Content after this section is automatically generated -->
|
||||
|
||||
@@ -13,6 +13,6 @@ children:
|
||||
- /redelivering-webhooks
|
||||
- /testing-webhooks
|
||||
- /troubleshooting-webhooks
|
||||
- /receiving-webhooks-with-the-github-cli
|
||||
- /using-the-github-cli-to-forward-webhooks-for-testing
|
||||
---
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Redelivering webhooks
|
||||
shortTitle: Redeliver webhooks
|
||||
intro: 'To help recover from failed deliveries, you can redeliver webhook deliveries from the past {% data variables.webhooks.retention %} days.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Testing webhooks
|
||||
shortTitle: Test webhooks
|
||||
intro: 'Learn how to test your webhooks and your code that handles webhook deliveries.'
|
||||
redirect_from:
|
||||
- /webhooks/testing
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Troubleshooting webhooks
|
||||
shortTitle: Troubleshoot webhooks
|
||||
intro: 'Learn how to diagnose and resolve common errors for webhooks.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
title: Receiving webhooks with the GitHub CLI
|
||||
title: Using the GitHub CLI to forward webhooks for testing
|
||||
intro: 'You can use the {% data variables.product.prodname_cli %} to test webhooks in your development environment without the complexity of port forwarding or third-party tools.'
|
||||
versions:
|
||||
feature: cli-webhook-forwarding
|
||||
topics:
|
||||
- Webhooks
|
||||
shortTitle: Receiving webhooks with the GitHub CLI
|
||||
shortTitle: Test with the CLI
|
||||
redirect_from:
|
||||
- /developers/webhooks-and-events/webhooks/receiving-webhooks-with-the-github-cli
|
||||
- /webhooks-and-events/webhooks/receiving-webhooks-with-the-github-cli
|
||||
- /webhooks/webhooks/receiving-webhooks-with-the-github-cli
|
||||
- /webhooks/receiving-webhooks-with-the-github-cli
|
||||
- /webhooks/testing-and-troubleshooting-webhooks/receiving-webhooks-with-the-github-cli
|
||||
---
|
||||
## About receiving webhooks with {% data variables.product.prodname_cli %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Viewing webhook deliveries
|
||||
shortTitle: View deliveries
|
||||
intro: 'You can view details about webhook deliveries from the past {% data variables.webhooks.retention %} days.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Creating webhooks
|
||||
shortTitle: Create webhooks
|
||||
intro: 'You can create webhooks to subscribe to specific events that occur on {% data variables.product.prodname_dotcom %}.'
|
||||
redirect_from:
|
||||
- /webhooks/creating
|
||||
@@ -70,6 +71,12 @@ After you create a new webhook, {% data variables.product.prodname_dotcom %} wil
|
||||
|
||||
Enterprise owners can create a global webhook to subscribe to events that occur within their enterprise.
|
||||
|
||||
{% ifversion ghes or ghae %}
|
||||
|
||||
You can use the {% data variables.product.company_short %} web interface or the REST API to create a global webhook. For more information about using the REST API to create a global webhook, see "[AUTOTITLE](/rest/enterprise-admin/global-webhooks)."
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||
{% data reusables.enterprise-accounts.settings-tab %}
|
||||
{% data reusables.enterprise-accounts.hooks-tab %}
|
||||
@@ -89,8 +96,6 @@ Enterprise owners can create a global webhook to subscribe to events that occur
|
||||
1. To make the webhook active immediately after adding the configuration, select **Active**.
|
||||
{% data reusables.webhooks.add_webhook_button %}
|
||||
|
||||
{% data reusables.enterprise_user_management.manage-global-webhooks-api %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Disabling webhooks
|
||||
shortTitle: Disable webhooks
|
||||
intro: 'You can disable a webhook to unsubscribe from events that occur on {% data variables.product.prodname_dotcom %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -51,13 +52,17 @@ You can use the {% data variables.product.prodname_dotcom %} web interface or th
|
||||
|
||||
Enterprise owners can disable a global webhook in an {% data variables.product.prodname_enterprise %}.
|
||||
|
||||
{% ifversion ghes or ghae %}
|
||||
|
||||
You can use the {% data variables.product.company_short %} web interface or the REST API to disable a global webhook. For more information about using the REST API to disable a global webhook, see "[AUTOTITLE](/rest/enterprise-admin/global-webhooks)."
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||
{% data reusables.enterprise-accounts.settings-tab %}
|
||||
{% data reusables.enterprise-accounts.hooks-tab %}
|
||||
{% data reusables.webhooks.disable_webhook %}
|
||||
|
||||
{% data reusables.enterprise_user_management.manage-global-webhooks-api %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Editing webhooks
|
||||
shortTitle: Edit webhooks
|
||||
intro: 'After creating a webhook, you can make changes to it.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -46,6 +47,12 @@ You can use the {% data variables.product.prodname_dotcom %} web interface or th
|
||||
|
||||
Enterprise owners can edit a global webhook to change any of the settings that were selected when the webhook was initially created.
|
||||
|
||||
{% ifversion ghes or ghae %}
|
||||
|
||||
You can use the {% data variables.product.company_short %} web interface or the REST API to edit a global webhook. For more information about using the REST API to edit a global webhook, see "[AUTOTITLE](/rest/enterprise-admin/global-webhooks)."
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||
{% data reusables.enterprise-accounts.settings-tab %}
|
||||
{% data reusables.enterprise-accounts.hooks-tab %}
|
||||
@@ -53,8 +60,6 @@ Enterprise owners can edit a global webhook to change any of the settings that w
|
||||
{% data reusables.webhooks.edit_webhook_make_changes %}
|
||||
{% data reusables.webhooks.update_webhook %}
|
||||
|
||||
{% data reusables.enterprise_user_management.manage-global-webhooks-api %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Handling failed webhook deliveries
|
||||
shortTitle: Handling failed deliveries
|
||||
shortTitle: Handle failed deliveries
|
||||
intro: '{% data variables.product.company_short %} does not automatically redeliver failed webhook deliveries, but you can handle failed deliveries manually or by writing code.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -216,7 +216,7 @@ async function fetchWebhookDeliveriesSince(lastWebhookRedeliveryTime) {
|
||||
);
|
||||
|
||||
const deliveries = [];
|
||||
|
||||
|
||||
for await (const { data } of iterator) {
|
||||
const oldestDeliveryTimestamp = new Date(
|
||||
data[data.length - 1].delivered_at
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Handling webhook deliveries
|
||||
shortTitle: Handle deliveries
|
||||
intro: 'Learn how to write code to listen for and respond to webhook deliveries.'
|
||||
redirect_from:
|
||||
- /webhooks/configuring
|
||||
@@ -203,7 +204,7 @@ npm install express
|
||||
Create a JavaScript file with the following contents. Modify the code to handle the event types that your webhook is subscribed to, as well as the `ping` event that {% data variables.product.company_short %} sends when you create a webhook. This example handles the `issues` and `ping` events.
|
||||
|
||||
```javascript copy annotate
|
||||
// You installed the `express` library earlier. For more information, see "[JavaScript example: Install dependencies](#javascript-example-install-dependencies)."
|
||||
// You installed the `express` library earlier. For more information, see "[JavaScript example: Install dependencies](#javascript-example-install-dependencies)."
|
||||
const express = require('express');
|
||||
|
||||
// This initializes a new Express application.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Validating webhook deliveries
|
||||
shortTitle: Validate deliveries
|
||||
intro: 'You can use a webhook secret to verify that a webhook delivery is from {% data variables.product.company_short %}.'
|
||||
redirect_from:
|
||||
- /webhooks/securing
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{% ifversion ghes or ghae %}
|
||||
You can also use the {% data variables.product.prodname_enterprise_api %} to manage global webhooks. For a complete list of actions, see "[AUTOTITLE](/rest/enterprise-admin/global-webhooks)."
|
||||
You can also use the REST API to manage global webhooks. For a complete list of endpoints, see "[AUTOTITLE](/rest/enterprise-admin/global-webhooks)."
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user