You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As [promised last month][notice], we've expanded several webhook events with new functionality. Webhook events involving repositories, issues, and comments have all been updated to include new actions.
7
+
8
+
Repository events will now fire when a repository is deleted, made public, or made private. In addition, while repository creation events will still only fire for organizations, the new repository event actions can be delivered for user-owned repositories.
9
+
10
+
Events for issues and comments have also been updated and will now fire when issues or comments are edited or deleted. When an issue or a comment has been edited, the event's payload will include a "changes" object. For example, if you've updated the title and body of an issue, the webhook payload informs you of what the issue used to look like:
11
+
12
+
```json
13
+
{
14
+
"action": "edited",
15
+
"changes": {
16
+
"title": { "from": "This is the old title." },
17
+
"body": { "from": "This is the old body." }
18
+
},
19
+
"issue": {
20
+
"title": "This is the new title.",
21
+
"body": "This is the new body."
22
+
}
23
+
}
24
+
```
25
+
26
+
The new values will be present in the `issue` object itself, as detailed above. Unchanged values will not be present within the `changes` object. Comment edits follow a similar pattern, though because they have no titles, the only change included in the payload would be the comment's body.
27
+
28
+
## List of comprehensive changes
29
+
30
+
New actions were added to four events, all of which are detailed below.
31
+
32
+
### [RepositoryEvent][repository-event]
33
+
34
+
*`deleted`: sent when a user-owned or organization-owned repository is deleted.
35
+
*`publicized`: sent when a user-owned or organization-owned repository is switched from private to public.
36
+
*`privatized`: sent when a user-owned or organization-owned repository is switched from public to private.
37
+
38
+
### [IssuesEvent][issues-event]
39
+
40
+
*`edited`: sent when the title and/or body of an issue or pull request is edited.
41
+
42
+
### [IssueCommentEvent][issue-comment-event]
43
+
44
+
*`edited`: sent when a comment on an issue or pull request is edited
45
+
*`deleted`: sent when a comment on an issue or pull request is deleted
Copy file name to clipboardExpand all lines: content/v3/activity/events/types.md
+22-15Lines changed: 22 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ Key | Type | Description
83
83
84
84
Represents a [deployment](/v3/repos/deployments/#list-deployments).
85
85
86
-
Events of this type are not visible in timelines, they are only used to trigger hooks.
86
+
Events of this type are not visible in timelines. These events are only used to trigger hooks.
87
87
88
88
### Events API payload
89
89
@@ -108,7 +108,7 @@ Key | Type | Description
108
108
109
109
Represents a [deployment status](/v3/repos/deployments/#list-deployment-statuses).
110
110
111
-
Events of this type are not visible in timelines, they are only used to trigger hooks.
111
+
Events of this type are not visible in timelines. These events are only used to trigger hooks.
112
112
113
113
### Events API payload
114
114
@@ -239,13 +239,15 @@ Key | Type | Description
239
239
240
240
## IssueCommentEvent
241
241
242
-
Triggered when an [issue comment](/v3/issues/comments/) is created on an issue or pull request.
242
+
Triggered when an [issue comment](/v3/issues/comments/) is created, edited, or deleted.
243
243
244
244
### Events API payload
245
245
246
246
Key | Type | Description
247
247
----|------|-------------
248
-
`action`|`string` | The action that was performed on the comment. Currently, can only be "created".
248
+
`action`|`string` | The action that was performed on the comment. Can be one of "created", "edited", or "deleted".
249
+
`changes`|`object` | The changes to the comment if the action was "edited".
250
+
`changes[from][body]` |`string` | The previous version of the body if the action was "edited".
249
251
`issue`|`object` | The [issue](/v3/issues/) the comment belongs to.
250
252
`comment`|`object` | The [comment](/v3/issues/comments/) itself.
251
253
@@ -259,14 +261,17 @@ Key | Type | Description
259
261
260
262
## IssuesEvent
261
263
262
-
Triggered when an [issue](/v3/issues) is assigned, unassigned, labeled, unlabeled, opened, closed, or reopened.
264
+
Triggered when an [issue](/v3/issues) is assigned, unassigned, labeled, unlabeled, opened, edited, closed, or reopened.
263
265
264
266
### Events API payload
265
267
266
268
Key | Type | Description
267
269
----|------|-------------
268
-
`action`|`string` | The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", "closed", or "reopened".
270
+
`action`|`string` | The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", or "reopened".
269
271
`issue`|`object` | The [issue](/v3/issues) itself.
272
+
`changes`|`object`| The changes to the issue if the action was "edited".
273
+
`changes[from][title]`|`string` | The previous version of the title if the action was "edited".
274
+
`changes[from][body]`|`string` | The previous version of the body if the action was "edited".
270
275
`assignee`|`object` | The optional user who was assigned or unassigned from the issue.
271
276
`label`|`object` | The optional label that was added or removed from the issue.
272
277
@@ -301,7 +306,7 @@ Key | Type | Description
301
306
302
307
Triggered when a user is added or removed from a team.
303
308
304
-
Events of this type are not visible in timelines, they are only used to trigger organization webhooks.
309
+
Events of this type are not visible in timelines. These events are only used to trigger hooks.
305
310
306
311
### Events API payload
307
312
@@ -326,7 +331,7 @@ Represents an attempted build of a GitHub Pages site, whether successful or not.
326
331
327
332
Triggered on push to a GitHub Pages enabled branch (`gh-pages` for project pages, `master` for user and organization pages).
328
333
329
-
Events of this type are not visible in timelines, they are only used to trigger hooks.
334
+
Events of this type are not visible in timelines. These events are only used to trigger hooks.
330
335
331
336
### Events API payload
332
337
@@ -378,13 +383,15 @@ Key | Type | Description
378
383
379
384
## PullRequestReviewCommentEvent
380
385
381
-
Triggered when a [comment is created on a portion of the unified diff](/v3/pulls/comments)of a pull request.
386
+
Triggered when a [comment on a Pull Request's unified diff](/v3/pulls/comments)is created, edited, or deleted (in the Files Changed tab).
382
387
383
388
### Events API payload
384
389
385
390
Key | Type | Description
386
391
----|------|-------------
387
-
`action`|`string` | The action that was performed on the comment. Currently, can only be "created".
392
+
`action`|`string` | The action that was performed on the comment. Can be one of `created`, `edited`, or `deleted`.
393
+
`changes`|`object`| The changes to the comment if the action was "edited".
394
+
`changes[from][body]`|`string` | The previous version of the body if the action was "edited".
388
395
`pull_request`|`object` | The [pull request](/v3/pulls/) the comment belongs to.
389
396
`comment`|`object` | The [comment](/v3/pulls/comments) itself.
390
397
@@ -453,16 +460,16 @@ Key | Type | Description
453
460
454
461
## RepositoryEvent
455
462
456
-
Triggered when a repository is created.
463
+
Triggered when a repository is created, deleted, made public, or made private.
457
464
458
-
Events of this type are not visible in timelines, they are only used to trigger organization webhooks.
465
+
Events of this type are not visible in timelines. These events are only used to trigger hooks.
459
466
460
467
### Events API payload
461
468
462
469
Key | Type | Description
463
470
----|------|-------------
464
-
`action` |`string` | The action that was performed. Currently, can only be "created".
465
-
`repository`|`object` | The [repository](/v3/repos/)that was created.
471
+
`action` |`string` | The action that was performed. This can be one of `created`, `deleted`, `publicized`, or `privatized`.
472
+
`repository`|`object` | The [repository](/v3/repos/)itself.
466
473
467
474
### Webhook event name
468
475
@@ -476,7 +483,7 @@ Key | Type | Description
476
483
477
484
Triggered when the status of a Git commit changes.
478
485
479
-
Events of this type are not visible in timelines, they are only used to trigger hooks.
486
+
Events of this type are not visible in timelines. These events are only used to trigger hooks.
Copy file name to clipboardExpand all lines: content/webhooks/index.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,16 +48,16 @@ Name | Description
48
48
[`deployment_status`][event-types-deployment_status] | Any time a deployment for a Repository has a status update from the API.
49
49
[`fork`][event-types-fork] | Any time a Repository is forked.
50
50
[`gollum`][event-types-gollum] | Any time a Wiki page is updated.
51
-
[`issue_comment`][event-types-issue_comment] | Any time an Issue or Pull Request is [commented](/v3/issues/comments/)on.
52
-
[`issues`][event-types-issues] | Any time an Issue is assigned, unassigned, labeled, unlabeled, opened, closed, or reopened.
51
+
[`issue_comment`][event-types-issue_comment] | Any time a [comment on an issue]([commented](/v3/issues/comments/)is created or edited
52
+
[`issues`][event-types-issues] | Any time an Issue is assigned, unassigned, labeled, unlabeled, opened, edited, closed, or reopened.
53
53
[`member`][event-types-member] | Any time a User is added as a collaborator to a non-Organization Repository.
54
54
[`membership`][event-types-membership] | Any time a User is added or removed from a team. **Organization hooks only**.
55
55
[`page_build`][event-types-page_build] | Any time a Pages site is built or results in a failed build.
56
56
[`public`][event-types-public] | Any time a Repository changes from private to public.
57
-
[`pull_request_review_comment`][event-types-pull_request_review_comment] | Any time a [comment is created on a portion of the unified diff](/v3/pulls/comments)of a pull request (the Files Changed tab).
57
+
[`pull_request_review_comment`][event-types-pull_request_review_comment] | Any time a [comment on a pull request's unified diff](/v3/pulls/comments) is created, edited, or deleted (in the Files Changed tab).
58
58
[`pull_request`][event-types-pull_request] | Any time a Pull Request is assigned, unassigned, labeled, unlabeled, opened, closed, reopened, or synchronized (updated due to a new push in the branch that the pull request is tracking).
59
59
[`push`][event-types-push] | Any Git push to a Repository, including editing tags or branches. Commits via API actions that update references are also counted. **This is the default event.**
60
-
[`repository`][event-types-repository] | Any time a Repository is created. **Organization hooks only**.
60
+
[`repository`][event-types-repository] | Any time a Repository is created, deleted, made public, or made private.
61
61
[`release`][event-types-release] | Any time a Release is published in a Repository.
62
62
[`status`][event-types-status] | Any time a Repository has a status update from the API
63
63
[`team_add`][event-types-team_add] | Any time a team is added or modified on a Repository.
0 commit comments