|
1 | 1 | ---
|
2 | 2 | description: Docker Hub Webhooks
|
3 | 3 | keywords: Docker, webhooks, hub, builds
|
4 |
| -title: Docker Hub Webhooks |
| 4 | +title: Webhooks |
5 | 5 | ---
|
6 | 6 |
|
7 | 7 | You can use webhooks to cause an action in another service in response to a push event in the repository. Webhooks are POST requests sent to a URL you define in Docker Hub.
|
8 | 8 |
|
9 |
| -Configure webhooks through the "Webhooks" tab on your Docker Hub repository: |
| 9 | +## Create a webhook |
10 | 10 |
|
11 |
| - |
| 11 | +To create a webhook: |
| 12 | +1. In your chosen respository, select the **Webhooks** tabThen: |
| 13 | +2. Provide a name for the webhook |
| 14 | +3. Provide a destination webhook URL. This is where webhook POST requests are delivered. |
| 15 | +4. Select **Create**. |
12 | 16 |
|
13 |
| -### Create Webhooks |
| 17 | +## View webhook delivery history |
14 | 18 |
|
15 |
| -To create a webhook, visit the webhooks tab for your repository. Then: |
16 |
| -1. Provide a name for the webhooks |
17 |
| -2. Provide a destination webhook URL. This is where webhook POST requests will be delivered: |
| 19 | +To view the history of the webhook: |
| 20 | +1. Hover over your webhook under the **Current Webhooks section**. |
| 21 | +2. Select the **Menu options** icon. |
| 22 | +3. Select **View History**. |
18 | 23 |
|
19 |
| - |
| 24 | +You can then view the delivery history, and whether delivering the POST request was successful or not: |
20 | 25 |
|
21 |
| -### View Webhook delivery history |
| 26 | +## Example webhook payload |
22 | 27 |
|
23 |
| -You can view Webhook Delivery History by clicking on the submenu of the webhook and then clicking "View History" |
24 |
| - |
25 |
| - |
26 |
| - |
27 |
| -You can then view the delivery history, and whether delivering the POST request was successful or failed: |
28 |
| - |
29 |
| - |
30 |
| - |
31 |
| -### Example Webhook payload |
32 |
| - |
33 |
| -Docker Hub Webhook payloads have the following payload JSON format: |
| 28 | +Webhook payloads have the following JSON format: |
34 | 29 |
|
35 | 30 | ```json
|
36 | 31 | {
|
@@ -60,23 +55,23 @@ Docker Hub Webhook payloads have the following payload JSON format:
|
60 | 55 | }
|
61 | 56 | ```
|
62 | 57 |
|
63 |
| -### Validate a webhook callback |
| 58 | +## Validate a webhook callback |
64 | 59 |
|
65 |
| -To validate a callback in a webhook chain, you need to |
| 60 | +To validate a callback in a webhook chain, you need to: |
66 | 61 |
|
67 | 62 | 1. Retrieve the `callback_url` value in the request's JSON payload.
|
68 | 63 | 2. Send a POST request to this URL containing a valid JSON body.
|
69 | 64 |
|
70 |
| -> **Note**: A chain request is only considered complete once the last |
71 |
| -> callback has been validated. |
72 |
| -
|
| 65 | +> **Note** |
| 66 | +> |
| 67 | +> A chain request is only considered complete once the last callback is validated. |
73 | 68 |
|
74 |
| -#### Callback JSON data |
| 69 | +### Callback JSON data |
75 | 70 |
|
76 | 71 | The following parameters are recognized in callback data:
|
77 | 72 |
|
78 | 73 | * `state` (required): Accepted values are `success`, `failure`, and `error`.
|
79 |
| - If the state isn't `success`, the Webhook chain is interrupted. |
| 74 | + If the state isn't `success`, the webhook chain is interrupted. |
80 | 75 | * `description`: A string containing miscellaneous information that is
|
81 | 76 | available on Docker Hub. Maximum 255 characters.
|
82 | 77 | * `context`: A string containing the context of the operation. Can be retrieved
|
|
0 commit comments