From 211edbfa0afea1f61e282ae5d55f05e9ebc58fe1 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 13 Oct 2020 20:35:56 +0100 Subject: [PATCH 1/2] Correct the commits SHA key name. When setting up a webhook recently I found the objects in the commits array did not have an 'sha' element, but did have an 'id'. --- .../webhooks-and-events/webhook-events-and-payloads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/developers/webhooks-and-events/webhook-events-and-payloads.md b/content/developers/webhooks-and-events/webhook-events-and-payloads.md index bb2310d0cfeb..170e57473716 100644 --- a/content/developers/webhooks-and-events/webhook-events-and-payloads.md +++ b/content/developers/webhooks-and-events/webhook-events-and-payloads.md @@ -971,7 +971,7 @@ Key | Type | Description `before`|`string` | The SHA of the most recent commit on `ref` before the push. `after`|`string` | The SHA of the most recent commit on `ref` after the push. `commits`|`array` | An array of commit objects describing the pushed commits. (The array includes a maximum of 20 commits. If necessary, you can use the [Commits API](/v3/repos/commits/) to fetch additional commits. This limit is applied to timeline events only and isn't applied to webhook deliveries.) -`commits[][sha]`|`string` | The SHA of the commit. +`commits[][id]`|`string` | The SHA of the commit. `commits[][message]`|`string` | The commit message. `commits[][author]`|`object` | The git author of the commit. `commits[][author][name]`|`string` | The git author's name. From 05e4d63a86e21747f8b8f0ae7355127d0f95910c Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 13 Oct 2020 20:48:23 +0100 Subject: [PATCH 2/2] Describe some more elements of the commit object Document the timestamp, added, modified and removed keys of the commit object. --- .../webhooks-and-events/webhook-events-and-payloads.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/developers/webhooks-and-events/webhook-events-and-payloads.md b/content/developers/webhooks-and-events/webhook-events-and-payloads.md index 170e57473716..b27080c0d557 100644 --- a/content/developers/webhooks-and-events/webhook-events-and-payloads.md +++ b/content/developers/webhooks-and-events/webhook-events-and-payloads.md @@ -972,12 +972,16 @@ Key | Type | Description `after`|`string` | The SHA of the most recent commit on `ref` after the push. `commits`|`array` | An array of commit objects describing the pushed commits. (The array includes a maximum of 20 commits. If necessary, you can use the [Commits API](/v3/repos/commits/) to fetch additional commits. This limit is applied to timeline events only and isn't applied to webhook deliveries.) `commits[][id]`|`string` | The SHA of the commit. +`commits[][timestamp]`|`string` | The ISO 8601 timestamp of the commit. `commits[][message]`|`string` | The commit message. `commits[][author]`|`object` | The git author of the commit. `commits[][author][name]`|`string` | The git author's name. `commits[][author][email]`|`string` | The git author's email address. `commits[][url]`|`url` | URL that points to the commit API resource. `commits[][distinct]`|`boolean` | Whether this commit is distinct from any that have been pushed before. +`commits[][added]`|`array` | An array of files added in the commit. +`commits[][modified]`|`array` | An array of files modified by the commit. +`commits[][removed]`|`array` | An array of files removed in the commit. `pusher` | `object` | The user who pushed the commits. {% data reusables.webhooks.repo_desc %} {% data reusables.webhooks.org_desc %}