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
Copy file name to clipboardExpand all lines: content/v3/activity/events/types.md
+48-24Lines changed: 48 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Event Types | GitHub API
3
3
---
4
4
5
-
# Event Types
5
+
# Event Types & Payloads
6
6
7
7
Each event has a similar JSON schema, but a unique `payload` object that is
8
8
determined by its event type. [Repository hook](/v3/repos/hooks/) names relate to event types, and will have the exact same payload. The only exception to this is the `push` hook, which has a larger, more detailed payload.
@@ -21,7 +21,7 @@ They're only created for various internal and repository hooks.
21
21
22
22
Triggered when a [commit comment](/v3/repos/comments/#list-commit-comments-for-a-repository) is created.
23
23
24
-
### Hook name
24
+
### Event name
25
25
26
26
`commit_comment`
27
27
@@ -32,13 +32,15 @@ Key | Type | Description
32
32
`comment`|`object` | The [comment](/v3/repos/comments/#list-commit-comments-for-a-repository) itself.
33
33
34
34
35
+
<%= webhook_payload "commit_comment" %>
36
+
35
37
## CreateEvent
36
38
37
39
Represents a created repository, branch, or tag.
38
40
39
41
Note: webhooks will not receive this event for created repositories.
40
42
41
-
### Hook name
43
+
### Event name
42
44
43
45
`create`
44
46
@@ -51,12 +53,13 @@ Key | Type | Description
51
53
`master_branch`|`string` | The name of the repository's default branch (usually `master`).
52
54
`description`|`string` | The repository's current description.
53
55
56
+
<%= webhook_payload "create" %>
54
57
55
58
## DeleteEvent
56
59
57
60
Represents a [deleted branch or tag](/v3/git/refs/#delete-a-reference).
58
61
59
-
### Hook name
62
+
### Event name
60
63
61
64
`delete`
62
65
@@ -67,13 +70,15 @@ Key | Type | Description
67
70
`ref_type`|`string` | The object that was deleted. Can be "branch" or "tag".
68
71
`ref`|`string` | The full git ref.
69
72
73
+
<%= webhook_payload "delete" %>
74
+
70
75
## DeploymentEvent
71
76
72
77
Represents a [deployment](/v3/repos/deployments/#list-deployments).
73
78
74
79
Events of this type are not visible in timelines, they are only used to trigger hooks.
75
80
76
-
### Hook name
81
+
### Event name
77
82
78
83
`deployment`
79
84
@@ -88,13 +93,15 @@ Key | Type | Description
88
93
`description`|`string` | The optional human-readable description added to the deployment.
89
94
90
95
96
+
<%= webhook_payload "deployment" %>
97
+
91
98
## DeploymentStatusEvent
92
99
93
100
Represents a [deployment status](/v3/repos/deployments/#list-deployment-statuses).
94
101
95
102
Events of this type are not visible in timelines, they are only used to trigger hooks.
96
103
97
-
### Hook name
104
+
### Event name
98
105
99
106
`deployment_status`
100
107
@@ -107,13 +114,15 @@ Key | Type | Description
107
114
`deployment` |`hash` | The deployment that this status is associated with.
108
115
`description`|`string` | The optional human-readable description added to the status.
109
116
117
+
<%= webhook_payload "deployment_status" %>
118
+
110
119
## DownloadEvent
111
120
112
121
Triggered when a new [download](/v3/repos/downloads/) is created.
113
122
114
123
Events of this type are **no longer created**, but it's possible that they exist in timelines of some users.
115
124
116
-
### Hook name
125
+
### Event name
117
126
118
127
`download`
119
128
@@ -130,7 +139,7 @@ Triggered when a user [follows another user](/v3/users/followers/#follow-a-user)
130
139
131
140
Events of this type are **no longer created**, but it's possible that they exist in timelines of some users.
132
141
133
-
### Hook name
142
+
### Event name
134
143
135
144
`follow`
136
145
@@ -145,7 +154,7 @@ Key | Type | Description
145
154
146
155
Triggered when a user [forks a repository](/v3/repos/forks/#create-a-fork).
147
156
148
-
### Hook name
157
+
### Event name
149
158
150
159
`fork`
151
160
@@ -155,14 +164,15 @@ Key | Type | Description
155
164
----|------|-------------
156
165
`forkee`|`object` | The created [repository](/v3/repos/).
157
166
167
+
<%= webhook_payload "fork" %>
158
168
159
169
## ForkApplyEvent
160
170
161
171
Triggered when a patch is applied in the Fork Queue.
162
172
163
173
Events of this type are **no longer created**, but it's possible that they exist in timelines of some users.
164
174
165
-
### Hook name
175
+
### Event name
166
176
167
177
`fork_apply`
168
178
@@ -181,7 +191,7 @@ Triggered when a [Gist](/v3/gists/) is created or updated.
181
191
182
192
Events of this type are **no longer created**, but it's possible that they exist in timelines of some users.
183
193
184
-
### Hook name
194
+
### Event name
185
195
186
196
`gist`
187
197
@@ -197,7 +207,7 @@ Key | Type | Description
197
207
198
208
Triggered when a Wiki page is created or updated.
199
209
200
-
### Hook name
210
+
### Event name
201
211
202
212
`gollum`
203
213
@@ -212,12 +222,13 @@ Key | Type | Description
212
222
`pages[][sha]`|`string` | The latest commit SHA of the page.
213
223
`pages[][html_url]`|`string` | Points to the HTML wiki page.
214
224
225
+
<%= webhook_payload "gollum" %>
215
226
216
227
## IssueCommentEvent
217
228
218
229
Triggered when an [issue comment](/v3/issues/comments/) is created.
219
230
220
-
### Hook name
231
+
### Event name
221
232
222
233
`issue_comment`
223
234
@@ -229,12 +240,13 @@ Key | Type | Description
229
240
`issue`|`object` | The [issue](/v3/issues/) the comment belongs to.
230
241
`comment`|`object` | The [comment](/v3/issues/comments/) itself.
231
242
243
+
<%= webhook_payload "issue_comment" %>
232
244
233
245
## IssuesEvent
234
246
235
247
Triggered when an [issue](/v3/issues) is created, closed or reopened.
236
248
237
-
### Hook name
249
+
### Event name
238
250
239
251
`issues`
240
252
@@ -245,12 +257,13 @@ Key | Type | Description
245
257
`action`|`string` | The action that was performed. Can be one of "opened", "closed", or "reopened".
246
258
`issue`|`object` | The [issue](/v3/issues) itself.
247
259
260
+
<%= webhook_payload "issues" %>
248
261
249
262
## MemberEvent
250
263
251
264
Triggered when a user is [added as a collaborator](/v3/repos/collaborators/#add-collaborator) to a repository.
252
265
253
-
### Hook name
266
+
### Event name
254
267
255
268
`member`
256
269
@@ -261,6 +274,7 @@ Key | Type | Description
261
274
`member`|`object` | The [user](/v3/users/) that was added.
262
275
`action`|`string` | The action that was performed. Currently, can only be "added".
263
276
277
+
<%= webhook_payload "member" %>
264
278
265
279
## PageBuildEvent
266
280
@@ -280,24 +294,25 @@ Key | Type | Description
280
294
----|------|------------
281
295
`build` | `object` | The [page build](https://developer.github.com/v3/repos/pages/#list-pages-builds) itself.
282
296
297
+
<%= webhook_payload "page_build" %>
283
298
284
299
## PublicEvent
285
300
286
301
Triggered when a private repository is [open sourced](/v3/repos/#edit). Without a doubt: the best GitHub event.
287
302
288
-
### Hook name
303
+
### Event name
289
304
290
305
`public`
291
306
292
307
### Payload
293
308
294
-
(empty payload)
309
+
<%= webhook_payload "public" %>
295
310
296
311
## PullRequestEvent
297
312
298
313
Triggered when a [pull request](/v3/pulls) is created, closed, reopened or synchronized.
299
314
300
-
### Hook name
315
+
### Event name
301
316
302
317
`pull_request`
303
318
@@ -309,12 +324,13 @@ Key | Type | Description
309
324
`number`|`integer` | The pull request number.
310
325
`pull_request`|`object` | The [pull request](/v3/pulls) itself.
311
326
327
+
<%= webhook_payload "pull_request" %>
312
328
313
329
## PullRequestReviewCommentEvent
314
330
315
331
Triggered when a [comment is created on a portion of the unified diff](/v3/pulls/comments) of a pull request.
316
332
317
-
### Hook name
333
+
### Event name
318
334
319
335
`pull_request_review_comment`
320
336
@@ -326,12 +342,13 @@ Key | Type | Description
326
342
`pull_request`|`object` | The [pull request](/v3/pulls/) the comment belongs to.
327
343
`comment`|`object` | The [comment](/v3/pulls/comments) itself.
`commits[][url]`|`url` | Points to the commit API resource.
352
369
`commits[][distinct]`|`boolean` | Whether this commit is distinct from any that have been pushed before.
353
370
371
+
<%= webhook_payload "push" %>
372
+
354
373
## ReleaseEvent
355
374
356
375
Triggered when a [release](/v3/repos/releases/#get-a-single-release) is published.
357
376
358
-
### Hook name
377
+
### Event name
359
378
360
379
`release`
361
380
@@ -366,14 +385,15 @@ Key | Type | Description
366
385
`action`|`string` | The action that was performed. Currently, can only be "published".
367
386
`release`|`object` | The [release](/v3/repos/releases/#get-a-single-release) itself.
368
387
388
+
<%= webhook_payload "release" %>
369
389
370
390
## StatusEvent
371
391
372
392
Triggered when the status of a Git commit changes.
373
393
374
394
Events of this type are not visible in timelines, they are only used to trigger hooks.
375
395
376
-
### Hook name
396
+
### Event name
377
397
378
398
`status`
379
399
@@ -387,14 +407,15 @@ Key | Type | Description
387
407
`target_url`|`string` | The optional link added to the status.
388
408
`branches`|`array` | An array of branch objects containing the status' SHA. Each branch contains the given SHA, but the SHA may or may not be the head of the branch. The array includes a maximum of 10 branches.
389
409
410
+
<%= webhook_payload "status" %>
390
411
391
412
## TeamAddEvent
392
413
393
414
Triggered when a [user is added to a team](/v3/orgs/teams/#add-team-member) or when a [repository is added to a team](/v3/orgs/teams/#add-team-repo).
394
415
395
416
Note: this event is created in [users' organization timelines](/v3/activity/events/#list-events-for-an-organization).
396
417
397
-
### Hook name
418
+
### Event name
398
419
399
420
`team_add`
400
421
@@ -406,6 +427,7 @@ Key | Type | Description
406
427
`user`|`object` | The [user](/v3/users/) that was added to this team.
407
428
`repository`|`object` | The [repository](/v3/repos/) that was added to this team.
408
429
430
+
<%= webhook_payload "team_add" %>
409
431
410
432
## WatchEvent
411
433
@@ -415,7 +437,7 @@ See [this API blog post](/changes/2012-9-5-watcher-api/) for an explanation.
415
437
The event’s actor is the [user](/v3/users/) who starred a repository, and the
416
438
event’s repository is the [repository](/v3/repos/) that was starred.
417
439
418
-
### Hook name
440
+
### Event name
419
441
420
442
`watch`
421
443
@@ -424,3 +446,5 @@ event’s repository is the [repository](/v3/repos/) that was starred.
424
446
Key | Type | Description
425
447
----|------|-------------
426
448
`action`|`string` | The action that was performed. Currently, can only be `started`.
0 commit comments