dispatch_agents 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentservice/__init__.py +0 -0
- agentservice/py.typed +0 -0
- agentservice/v1/__init__.py +0 -0
- agentservice/v1/message_pb2.py +41 -0
- agentservice/v1/message_pb2.pyi +22 -0
- agentservice/v1/message_pb2_grpc.py +4 -0
- agentservice/v1/request_response_pb2.py +46 -0
- agentservice/v1/request_response_pb2.pyi +54 -0
- agentservice/v1/request_response_pb2_grpc.py +4 -0
- agentservice/v1/service_pb2.py +43 -0
- agentservice/v1/service_pb2.pyi +6 -0
- agentservice/v1/service_pb2_grpc.py +129 -0
- dispatch_agents/__init__.py +281 -0
- dispatch_agents/agent_service.py +135 -0
- dispatch_agents/config.py +490 -0
- dispatch_agents/contrib/__init__.py +1 -0
- dispatch_agents/contrib/claude/__init__.py +246 -0
- dispatch_agents/contrib/openai/__init__.py +167 -0
- dispatch_agents/events.py +986 -0
- dispatch_agents/grpc_server.py +565 -0
- dispatch_agents/instrument.py +217 -0
- dispatch_agents/integrations/__init__.py +1 -0
- dispatch_agents/integrations/github/README.md +9 -0
- dispatch_agents/integrations/github/__init__.py +4268 -0
- dispatch_agents/invocation.py +25 -0
- dispatch_agents/llm.py +1017 -0
- dispatch_agents/llm_langchain.py +394 -0
- dispatch_agents/logging_config.py +133 -0
- dispatch_agents/mcp.py +266 -0
- dispatch_agents/memory.py +264 -0
- dispatch_agents/models.py +748 -0
- dispatch_agents/proxy/__init__.py +6 -0
- dispatch_agents/proxy/server.py +1137 -0
- dispatch_agents/proxy/sse_utils.py +76 -0
- dispatch_agents/py.typed +0 -0
- dispatch_agents/resources.py +68 -0
- dispatch_agents/version.py +19 -0
- dispatch_agents-0.9.0.dist-info/METADATA +20 -0
- dispatch_agents-0.9.0.dist-info/RECORD +43 -0
- dispatch_agents-0.9.0.dist-info/WHEEL +4 -0
- dispatch_agents-0.9.0.dist-info/licenses/LICENSE +191 -0
- dispatch_agents-0.9.0.dist-info/licenses/LICENSE-3rdparty.csv +12 -0
- dispatch_agents-0.9.0.dist-info/licenses/NOTICE +5 -0
|
@@ -0,0 +1,4268 @@
|
|
|
1
|
+
"""GitHub integration for Dispatch agents.
|
|
2
|
+
|
|
3
|
+
This module provides typed payloads for GitHub webhook events that can be used
|
|
4
|
+
with the @on(github_event=...) decorator.
|
|
5
|
+
|
|
6
|
+
Quick Start:
|
|
7
|
+
from dispatch_agents import on
|
|
8
|
+
from dispatch_agents.integrations.github import PullRequestOpened
|
|
9
|
+
|
|
10
|
+
@on(github_event=PullRequestOpened)
|
|
11
|
+
async def handle_pr(payload: PullRequestOpened) -> None:
|
|
12
|
+
print(f"New PR from @{payload.sender.login}: {payload.pull_request.title}")
|
|
13
|
+
|
|
14
|
+
# Subscribe to multiple events using base class
|
|
15
|
+
from dispatch_agents.integrations.github import (
|
|
16
|
+
PullRequestOpened,
|
|
17
|
+
PullRequestSynchronize,
|
|
18
|
+
PullRequestBase,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
@on(github_event=[PullRequestOpened, PullRequestSynchronize])
|
|
22
|
+
async def handle_pr_changes(payload: PullRequestBase) -> None:
|
|
23
|
+
...
|
|
24
|
+
|
|
25
|
+
Action-Specific Event Classes:
|
|
26
|
+
Each GitHub event has its own class that can be used with @on(github_event=...):
|
|
27
|
+
- PullRequestOpened, PullRequestClosed, PullRequestSynchronize, ...
|
|
28
|
+
- IssueOpened, IssueClosed, IssueLabeled, ...
|
|
29
|
+
- IssueCommentCreated, IssueCommentEdited, ...
|
|
30
|
+
- Push (no action)
|
|
31
|
+
- CheckRunCreated, CheckRunCompleted, ...
|
|
32
|
+
- WorkflowRunCompleted, ...
|
|
33
|
+
- ReleasePublished, ...
|
|
34
|
+
- Create, Delete, Fork (no action)
|
|
35
|
+
- StarCreated, StarDeleted
|
|
36
|
+
- InstallationCreated, ...
|
|
37
|
+
- DeploymentCreated
|
|
38
|
+
- DeploymentStatusCreated
|
|
39
|
+
- DeploymentReviewApproved, DeploymentReviewRejected, DeploymentReviewRequested
|
|
40
|
+
- DependabotAlertCreated, DependabotAlertFixed, DependabotAlertDismissed,
|
|
41
|
+
DependabotAlertReintroduced, DependabotAlertAutoDismissed,
|
|
42
|
+
DependabotAlertAutoReopened, DependabotAlertReopened
|
|
43
|
+
- LabelCreated, LabelEdited, LabelDeleted
|
|
44
|
+
|
|
45
|
+
No-Action Events:
|
|
46
|
+
Events with no action field (subscribe directly to the event class):
|
|
47
|
+
- CommitStatus
|
|
48
|
+
- WorkflowDispatch
|
|
49
|
+
|
|
50
|
+
Base Classes (for subscribing to multiple events):
|
|
51
|
+
- PullRequestBase: All pull_request.* events
|
|
52
|
+
- IssueBase: All issues.* events
|
|
53
|
+
- IssueCommentBase: All issue_comment.* events
|
|
54
|
+
- CheckRunBase: All check_run.* events
|
|
55
|
+
- WorkflowRunBase: All workflow_run.* events
|
|
56
|
+
- ReleaseBase: All release.* events
|
|
57
|
+
- StarBase: All star.* events
|
|
58
|
+
- InstallationBase: All installation.* events
|
|
59
|
+
- DeploymentBase: All deployment.* events
|
|
60
|
+
- DeploymentStatusBase: All deployment_status.* events
|
|
61
|
+
- DeploymentReviewBase: All deployment_review.* events
|
|
62
|
+
- DependabotAlertBase: All dependabot_alert.* events
|
|
63
|
+
- LabelBase: All label.* events
|
|
64
|
+
|
|
65
|
+
GitHub Topics:
|
|
66
|
+
Events are routed to topics with the pattern "github.{event}.{action}":
|
|
67
|
+
- github.pull_request.opened
|
|
68
|
+
- github.pull_request.synchronize
|
|
69
|
+
- github.issue_comment.created
|
|
70
|
+
- github.push (no action for push events)
|
|
71
|
+
- github.check_run.completed
|
|
72
|
+
- github.deployment.created
|
|
73
|
+
- github.deployment_status.created
|
|
74
|
+
- github.deployment_review.approved
|
|
75
|
+
- github.deployment_review.rejected
|
|
76
|
+
- github.deployment_review.requested
|
|
77
|
+
- github.status (no action for commit status events)
|
|
78
|
+
- github.workflow_dispatch (no action for workflow dispatch events)
|
|
79
|
+
- github.dependabot_alert.created
|
|
80
|
+
- github.label.created
|
|
81
|
+
- etc.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
from __future__ import annotations
|
|
85
|
+
|
|
86
|
+
from typing import Any, ClassVar, Literal
|
|
87
|
+
|
|
88
|
+
from pydantic import ConfigDict, Field
|
|
89
|
+
|
|
90
|
+
from dispatch_agents.events import BasePayload
|
|
91
|
+
from dispatch_agents.models import StrictBaseModel
|
|
92
|
+
|
|
93
|
+
# =============================================================================
|
|
94
|
+
# Constants
|
|
95
|
+
# =============================================================================
|
|
96
|
+
|
|
97
|
+
# Topic prefix for all GitHub events
|
|
98
|
+
GITHUB_TOPIC_PREFIX = "github."
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# =============================================================================
|
|
102
|
+
# GitHubEvent Enum
|
|
103
|
+
# =============================================================================
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# =============================================================================
|
|
107
|
+
# Base GitHub Model
|
|
108
|
+
# =============================================================================
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class GitHubModel(StrictBaseModel):
|
|
112
|
+
"""Base model for GitHub types with permissive validation.
|
|
113
|
+
|
|
114
|
+
GitHub webhooks include many fields that may not be relevant to most
|
|
115
|
+
use cases. We use 'ignore' for extra fields to allow forward compatibility
|
|
116
|
+
as GitHub adds new fields to their API.
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
model_config = ConfigDict(extra="ignore", populate_by_name=True)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
# =============================================================================
|
|
123
|
+
# Core GitHub Types
|
|
124
|
+
# =============================================================================
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class GitHubUser(GitHubModel):
|
|
128
|
+
"""GitHub user or organization account."""
|
|
129
|
+
|
|
130
|
+
id: int = Field(description="Unique numeric ID")
|
|
131
|
+
login: str = Field(description="Username/handle")
|
|
132
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
133
|
+
avatar_url: str | None = Field(default=None, description="Avatar image URL")
|
|
134
|
+
html_url: str | None = Field(default=None, description="Profile URL")
|
|
135
|
+
type: str = Field(
|
|
136
|
+
default="User", description="Account type: User, Bot, or Organization"
|
|
137
|
+
)
|
|
138
|
+
site_admin: bool = Field(
|
|
139
|
+
default=False, description="Whether user is a GitHub site admin"
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class GitHubLabel(GitHubModel):
|
|
144
|
+
"""Label attached to issues or pull requests."""
|
|
145
|
+
|
|
146
|
+
id: int = Field(description="Unique numeric ID")
|
|
147
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
148
|
+
url: str | None = Field(default=None, description="API URL")
|
|
149
|
+
name: str = Field(description="Label name")
|
|
150
|
+
description: str | None = Field(default=None, description="Label description")
|
|
151
|
+
color: str = Field(description="Hex color code (without #)")
|
|
152
|
+
default: bool = Field(default=False, description="Whether this is a default label")
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class GitHubMilestone(GitHubModel):
|
|
156
|
+
"""Milestone for tracking progress on issues/PRs."""
|
|
157
|
+
|
|
158
|
+
id: int = Field(description="Unique numeric ID")
|
|
159
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
160
|
+
number: int = Field(description="Milestone number")
|
|
161
|
+
title: str = Field(description="Milestone title")
|
|
162
|
+
description: str | None = Field(default=None, description="Milestone description")
|
|
163
|
+
state: str = Field(description="State: open or closed")
|
|
164
|
+
creator: GitHubUser | None = Field(
|
|
165
|
+
default=None, description="User who created the milestone"
|
|
166
|
+
)
|
|
167
|
+
open_issues: int = Field(default=0, description="Number of open issues")
|
|
168
|
+
closed_issues: int = Field(default=0, description="Number of closed issues")
|
|
169
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
170
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
171
|
+
due_on: str | None = Field(default=None, description="ISO8601 due date")
|
|
172
|
+
closed_at: str | None = Field(default=None, description="ISO8601 close timestamp")
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class GitHubLicense(GitHubModel):
|
|
176
|
+
"""Repository license information."""
|
|
177
|
+
|
|
178
|
+
key: str = Field(description="License identifier (e.g., 'mit')")
|
|
179
|
+
name: str = Field(description="License name")
|
|
180
|
+
spdx_id: str | None = Field(default=None, description="SPDX license identifier")
|
|
181
|
+
url: str | None = Field(default=None, description="URL to license text")
|
|
182
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class GitHubRepository(GitHubModel):
|
|
186
|
+
"""GitHub repository."""
|
|
187
|
+
|
|
188
|
+
id: int = Field(description="Unique numeric ID")
|
|
189
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
190
|
+
name: str = Field(description="Repository name (without owner)")
|
|
191
|
+
full_name: str = Field(description="Full repository name (owner/repo)")
|
|
192
|
+
owner: GitHubUser = Field(description="Repository owner")
|
|
193
|
+
private: bool = Field(default=False, description="Whether repository is private")
|
|
194
|
+
html_url: str | None = Field(default=None, description="Web URL")
|
|
195
|
+
description: str | None = Field(default=None, description="Repository description")
|
|
196
|
+
fork: bool = Field(default=False, description="Whether this is a fork")
|
|
197
|
+
url: str | None = Field(default=None, description="API URL")
|
|
198
|
+
created_at: str | None = Field(
|
|
199
|
+
default=None, description="ISO8601 creation timestamp"
|
|
200
|
+
)
|
|
201
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
202
|
+
pushed_at: str | None = Field(
|
|
203
|
+
default=None, description="ISO8601 last push timestamp"
|
|
204
|
+
)
|
|
205
|
+
homepage: str | None = Field(default=None, description="Homepage URL")
|
|
206
|
+
size: int = Field(default=0, description="Repository size in KB")
|
|
207
|
+
stargazers_count: int = Field(default=0, description="Number of stars")
|
|
208
|
+
watchers_count: int = Field(default=0, description="Number of watchers")
|
|
209
|
+
language: str | None = Field(default=None, description="Primary language")
|
|
210
|
+
forks_count: int = Field(default=0, description="Number of forks")
|
|
211
|
+
open_issues_count: int = Field(default=0, description="Number of open issues")
|
|
212
|
+
default_branch: str = Field(default="main", description="Default branch name")
|
|
213
|
+
license: GitHubLicense | None = Field(
|
|
214
|
+
default=None, description="License information"
|
|
215
|
+
)
|
|
216
|
+
visibility: str = Field(default="public", description="Repository visibility")
|
|
217
|
+
topics: list[str] = Field(
|
|
218
|
+
default_factory=list, description="Repository topics/tags"
|
|
219
|
+
)
|
|
220
|
+
archived: bool = Field(default=False, description="Whether repository is archived")
|
|
221
|
+
disabled: bool = Field(default=False, description="Whether repository is disabled")
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class GitHubBranch(GitHubModel):
|
|
225
|
+
"""Branch reference in a pull request."""
|
|
226
|
+
|
|
227
|
+
label: str | None = Field(default=None, description="Branch label (owner:branch)")
|
|
228
|
+
ref: str = Field(description="Branch name")
|
|
229
|
+
sha: str = Field(description="Commit SHA")
|
|
230
|
+
user: GitHubUser | None = Field(
|
|
231
|
+
default=None, description="User who owns the branch"
|
|
232
|
+
)
|
|
233
|
+
repo: GitHubRepository | None = Field(
|
|
234
|
+
default=None, description="Repository containing the branch"
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
class GitHubInstallation(GitHubModel):
|
|
239
|
+
"""GitHub App installation information.
|
|
240
|
+
|
|
241
|
+
Present in webhook payloads when the event is delivered to a GitHub App.
|
|
242
|
+
"""
|
|
243
|
+
|
|
244
|
+
id: int = Field(description="Installation ID (used for authentication)")
|
|
245
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
246
|
+
account: GitHubUser | None = Field(
|
|
247
|
+
default=None, description="Account where App is installed"
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
# =============================================================================
|
|
252
|
+
# Pull Request Types
|
|
253
|
+
# =============================================================================
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class GitHubLink(GitHubModel):
|
|
257
|
+
"""A hypermedia link (HAL-style {"href": "..."})."""
|
|
258
|
+
|
|
259
|
+
href: str = Field(description="URL of the linked resource")
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
class GitHubPullRequestLinks(GitHubModel):
|
|
263
|
+
"""Hypermedia links for a pull request."""
|
|
264
|
+
|
|
265
|
+
html: GitHubLink | None = Field(default=None, description="Link to HTML view")
|
|
266
|
+
diff: GitHubLink | None = Field(default=None, description="Link to diff")
|
|
267
|
+
patch: GitHubLink | None = Field(default=None, description="Link to patch")
|
|
268
|
+
self_link: GitHubLink | None = Field(
|
|
269
|
+
default=None, alias="self", description="Link to this resource"
|
|
270
|
+
)
|
|
271
|
+
comments: GitHubLink | None = Field(default=None, description="Link to comments")
|
|
272
|
+
review_comments: GitHubLink | None = Field(
|
|
273
|
+
default=None, description="Link to review comments"
|
|
274
|
+
)
|
|
275
|
+
review_comment: GitHubLink | None = Field(
|
|
276
|
+
default=None, description="Link to review comment template"
|
|
277
|
+
)
|
|
278
|
+
commits: GitHubLink | None = Field(default=None, description="Link to commits")
|
|
279
|
+
statuses: GitHubLink | None = Field(default=None, description="Link to statuses")
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
class GitHubAutoMerge(GitHubModel):
|
|
283
|
+
"""Auto-merge configuration for a pull request."""
|
|
284
|
+
|
|
285
|
+
enabled_by: GitHubUser = Field(description="User who enabled auto-merge")
|
|
286
|
+
merge_method: str = Field(description="Merge method: merge, squash, or rebase")
|
|
287
|
+
commit_title: str | None = Field(
|
|
288
|
+
default=None, description="Commit title for squash/merge"
|
|
289
|
+
)
|
|
290
|
+
commit_message: str | None = Field(
|
|
291
|
+
default=None, description="Commit message for squash/merge"
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
class GitHubPullRequest(GitHubModel):
|
|
296
|
+
"""Pull request data."""
|
|
297
|
+
|
|
298
|
+
id: int = Field(description="Unique numeric ID")
|
|
299
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
300
|
+
number: int = Field(description="PR number within the repository")
|
|
301
|
+
state: str = Field(description="State: open, closed")
|
|
302
|
+
locked: bool = Field(default=False, description="Whether PR is locked")
|
|
303
|
+
title: str = Field(description="PR title")
|
|
304
|
+
body: str | None = Field(default=None, description="PR description body")
|
|
305
|
+
user: GitHubUser = Field(description="User who opened the PR")
|
|
306
|
+
labels: list[GitHubLabel] = Field(
|
|
307
|
+
default_factory=list, description="Labels attached to PR"
|
|
308
|
+
)
|
|
309
|
+
milestone: GitHubMilestone | None = Field(
|
|
310
|
+
default=None, description="Associated milestone"
|
|
311
|
+
)
|
|
312
|
+
assignee: GitHubUser | None = Field(default=None, description="Primary assignee")
|
|
313
|
+
assignees: list[GitHubUser] = Field(
|
|
314
|
+
default_factory=list, description="All assignees"
|
|
315
|
+
)
|
|
316
|
+
requested_reviewers: list[GitHubUser] = Field(
|
|
317
|
+
default_factory=list, description="Requested reviewers"
|
|
318
|
+
)
|
|
319
|
+
head: GitHubBranch = Field(description="Source branch")
|
|
320
|
+
base: GitHubBranch = Field(description="Target branch")
|
|
321
|
+
html_url: str | None = Field(default=None, description="Web URL")
|
|
322
|
+
diff_url: str | None = Field(default=None, description="Diff URL")
|
|
323
|
+
patch_url: str | None = Field(default=None, description="Patch URL")
|
|
324
|
+
created_at: str | None = Field(
|
|
325
|
+
default=None, description="ISO8601 creation timestamp"
|
|
326
|
+
)
|
|
327
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
328
|
+
closed_at: str | None = Field(default=None, description="ISO8601 close timestamp")
|
|
329
|
+
merged_at: str | None = Field(default=None, description="ISO8601 merge timestamp")
|
|
330
|
+
merge_commit_sha: str | None = Field(default=None, description="Merge commit SHA")
|
|
331
|
+
merged: bool = Field(default=False, description="Whether PR is merged")
|
|
332
|
+
mergeable: bool | None = Field(default=None, description="Whether PR is mergeable")
|
|
333
|
+
mergeable_state: str | None = Field(default=None, description="Mergeable state")
|
|
334
|
+
merged_by: GitHubUser | None = Field(default=None, description="User who merged")
|
|
335
|
+
comments: int = Field(default=0, description="Number of comments")
|
|
336
|
+
review_comments: int = Field(default=0, description="Number of review comments")
|
|
337
|
+
commits: int = Field(default=0, description="Number of commits")
|
|
338
|
+
additions: int = Field(default=0, description="Lines added")
|
|
339
|
+
deletions: int = Field(default=0, description="Lines deleted")
|
|
340
|
+
changed_files: int = Field(default=0, description="Number of files changed")
|
|
341
|
+
draft: bool = Field(default=False, description="Whether PR is a draft")
|
|
342
|
+
auto_merge: GitHubAutoMerge | None = Field(
|
|
343
|
+
default=None, description="Auto-merge settings"
|
|
344
|
+
)
|
|
345
|
+
links: GitHubPullRequestLinks | None = Field(
|
|
346
|
+
default=None, alias="_links", description="Hypermedia links"
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
# =============================================================================
|
|
351
|
+
# Issue Types
|
|
352
|
+
# =============================================================================
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
class GitHubIssuePullRequest(GitHubModel):
|
|
356
|
+
"""Pull request info embedded in an issue (present when the issue is a PR)."""
|
|
357
|
+
|
|
358
|
+
url: str | None = Field(default=None, description="API URL")
|
|
359
|
+
html_url: str | None = Field(default=None, description="Web URL")
|
|
360
|
+
diff_url: str | None = Field(default=None, description="Diff URL")
|
|
361
|
+
patch_url: str | None = Field(default=None, description="Patch URL")
|
|
362
|
+
merged_at: str | None = Field(default=None, description="ISO8601 merge timestamp")
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
class GitHubIssue(GitHubModel):
|
|
366
|
+
"""GitHub issue."""
|
|
367
|
+
|
|
368
|
+
id: int = Field(description="Unique numeric ID")
|
|
369
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
370
|
+
number: int = Field(description="Issue number within the repository")
|
|
371
|
+
title: str = Field(description="Issue title")
|
|
372
|
+
body: str | None = Field(default=None, description="Issue description body")
|
|
373
|
+
user: GitHubUser = Field(description="User who opened the issue")
|
|
374
|
+
labels: list[GitHubLabel] = Field(default_factory=list, description="Labels")
|
|
375
|
+
state: str = Field(description="State: open or closed")
|
|
376
|
+
state_reason: str | None = Field(
|
|
377
|
+
default=None, description="Reason for state (completed, not_planned, reopened)"
|
|
378
|
+
)
|
|
379
|
+
locked: bool = Field(default=False, description="Whether issue is locked")
|
|
380
|
+
assignee: GitHubUser | None = Field(default=None, description="Primary assignee")
|
|
381
|
+
assignees: list[GitHubUser] = Field(
|
|
382
|
+
default_factory=list, description="All assignees"
|
|
383
|
+
)
|
|
384
|
+
milestone: GitHubMilestone | None = Field(
|
|
385
|
+
default=None, description="Associated milestone"
|
|
386
|
+
)
|
|
387
|
+
comments: int = Field(default=0, description="Number of comments")
|
|
388
|
+
created_at: str | None = Field(
|
|
389
|
+
default=None, description="ISO8601 creation timestamp"
|
|
390
|
+
)
|
|
391
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
392
|
+
closed_at: str | None = Field(default=None, description="ISO8601 close timestamp")
|
|
393
|
+
html_url: str | None = Field(default=None, description="Web URL")
|
|
394
|
+
# Pull request info is present when the issue is actually a PR
|
|
395
|
+
pull_request: GitHubIssuePullRequest | None = Field(
|
|
396
|
+
default=None, description="PR info if this issue is a PR"
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
class GitHubComment(GitHubModel):
|
|
401
|
+
"""Comment on an issue or pull request."""
|
|
402
|
+
|
|
403
|
+
id: int = Field(description="Unique numeric ID")
|
|
404
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
405
|
+
html_url: str = Field(description="Web URL")
|
|
406
|
+
body: str = Field(description="Comment body (markdown)")
|
|
407
|
+
user: GitHubUser = Field(description="User who created the comment")
|
|
408
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
409
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
410
|
+
author_association: str = Field(
|
|
411
|
+
default="NONE",
|
|
412
|
+
description="Author's association with the repository: OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, etc.",
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
class GitHubReviewComment(GitHubModel):
|
|
417
|
+
"""Review comment on a pull request diff."""
|
|
418
|
+
|
|
419
|
+
id: int = Field(description="Unique numeric ID")
|
|
420
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
421
|
+
pull_request_review_id: int | None = Field(
|
|
422
|
+
default=None, description="Associated review ID"
|
|
423
|
+
)
|
|
424
|
+
diff_hunk: str = Field(description="Diff context")
|
|
425
|
+
path: str = Field(description="File path")
|
|
426
|
+
position: int | None = Field(default=None, description="Position in diff")
|
|
427
|
+
original_position: int | None = Field(default=None, description="Original position")
|
|
428
|
+
commit_id: str = Field(description="Commit SHA")
|
|
429
|
+
original_commit_id: str | None = Field(
|
|
430
|
+
default=None, description="Original commit SHA"
|
|
431
|
+
)
|
|
432
|
+
user: GitHubUser = Field(description="Comment author")
|
|
433
|
+
body: str = Field(description="Comment body")
|
|
434
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
435
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
436
|
+
html_url: str = Field(description="Web URL")
|
|
437
|
+
line: int | None = Field(default=None, description="Line number")
|
|
438
|
+
original_line: int | None = Field(default=None, description="Original line number")
|
|
439
|
+
start_line: int | None = Field(
|
|
440
|
+
default=None, description="Start line for multi-line comments"
|
|
441
|
+
)
|
|
442
|
+
side: str | None = Field(
|
|
443
|
+
default=None, description="Side of the diff: LEFT or RIGHT"
|
|
444
|
+
)
|
|
445
|
+
author_association: str = Field(
|
|
446
|
+
default="NONE", description="Author's repository association"
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
class GitHubReview(GitHubModel):
|
|
451
|
+
"""Pull request review."""
|
|
452
|
+
|
|
453
|
+
id: int = Field(description="Unique numeric ID")
|
|
454
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
455
|
+
user: GitHubUser = Field(description="Reviewer")
|
|
456
|
+
body: str | None = Field(default=None, description="Review body")
|
|
457
|
+
state: str = Field(
|
|
458
|
+
description="Review state: APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED, PENDING"
|
|
459
|
+
)
|
|
460
|
+
html_url: str = Field(description="Web URL")
|
|
461
|
+
submitted_at: str | None = Field(
|
|
462
|
+
default=None, description="ISO8601 submission timestamp"
|
|
463
|
+
)
|
|
464
|
+
commit_id: str = Field(description="Commit SHA being reviewed")
|
|
465
|
+
author_association: str = Field(
|
|
466
|
+
default="NONE", description="Reviewer's repository association"
|
|
467
|
+
)
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
# =============================================================================
|
|
471
|
+
# Commit Types
|
|
472
|
+
# =============================================================================
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
class GitHubCommitUser(GitHubModel):
|
|
476
|
+
"""Git user information (author/committer)."""
|
|
477
|
+
|
|
478
|
+
name: str = Field(description="Git user name")
|
|
479
|
+
email: str = Field(description="Git user email")
|
|
480
|
+
username: str | None = Field(default=None, description="GitHub username if linked")
|
|
481
|
+
date: str | None = Field(default=None, description="ISO8601 timestamp")
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
class GitHubCommit(GitHubModel):
|
|
485
|
+
"""Git commit in a push event."""
|
|
486
|
+
|
|
487
|
+
id: str = Field(description="Commit SHA")
|
|
488
|
+
tree_id: str = Field(description="Tree SHA")
|
|
489
|
+
message: str = Field(description="Commit message")
|
|
490
|
+
timestamp: str = Field(description="ISO8601 timestamp")
|
|
491
|
+
author: GitHubCommitUser = Field(description="Commit author")
|
|
492
|
+
committer: GitHubCommitUser = Field(description="Commit committer")
|
|
493
|
+
url: str = Field(description="API URL")
|
|
494
|
+
distinct: bool = Field(
|
|
495
|
+
default=True, description="Whether commit is distinct from previous pushes"
|
|
496
|
+
)
|
|
497
|
+
added: list[str] = Field(default_factory=list, description="Files added")
|
|
498
|
+
removed: list[str] = Field(default_factory=list, description="Files removed")
|
|
499
|
+
modified: list[str] = Field(default_factory=list, description="Files modified")
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
# =============================================================================
|
|
503
|
+
# Check Run / Workflow Types
|
|
504
|
+
# =============================================================================
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
class GitHubCheckRunOutput(GitHubModel):
|
|
508
|
+
"""Output of a check run."""
|
|
509
|
+
|
|
510
|
+
title: str | None = Field(default=None, description="Check run title")
|
|
511
|
+
summary: str | None = Field(default=None, description="Check run summary")
|
|
512
|
+
text: str | None = Field(default=None, description="Check run details")
|
|
513
|
+
annotations_count: int = Field(default=0, description="Number of annotations")
|
|
514
|
+
annotations_url: str | None = Field(default=None, description="Annotations API URL")
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
class GitHubCheckSuite(GitHubModel):
|
|
518
|
+
"""Check suite containing one or more check runs."""
|
|
519
|
+
|
|
520
|
+
id: int = Field(description="Unique numeric ID")
|
|
521
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
522
|
+
head_branch: str | None = Field(default=None, description="Branch name")
|
|
523
|
+
head_sha: str = Field(description="Head commit SHA")
|
|
524
|
+
status: str | None = Field(
|
|
525
|
+
default=None, description="Status: queued, in_progress, completed"
|
|
526
|
+
)
|
|
527
|
+
conclusion: str | None = Field(
|
|
528
|
+
default=None, description="Conclusion: success, failure, etc."
|
|
529
|
+
)
|
|
530
|
+
url: str | None = Field(default=None, description="API URL")
|
|
531
|
+
created_at: str | None = Field(
|
|
532
|
+
default=None, description="ISO8601 creation timestamp"
|
|
533
|
+
)
|
|
534
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
class GitHubCheckRun(GitHubModel):
|
|
538
|
+
"""Individual check run (CI job)."""
|
|
539
|
+
|
|
540
|
+
id: int = Field(description="Unique numeric ID")
|
|
541
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
542
|
+
head_sha: str = Field(description="Commit SHA")
|
|
543
|
+
external_id: str | None = Field(default=None, description="External reference ID")
|
|
544
|
+
url: str | None = Field(default=None, description="API URL")
|
|
545
|
+
html_url: str | None = Field(default=None, description="Web URL")
|
|
546
|
+
details_url: str | None = Field(default=None, description="Details URL")
|
|
547
|
+
status: str = Field(description="Status: queued, in_progress, completed")
|
|
548
|
+
conclusion: str | None = Field(
|
|
549
|
+
default=None, description="Conclusion: success, failure, neutral, etc."
|
|
550
|
+
)
|
|
551
|
+
started_at: str | None = Field(default=None, description="ISO8601 start timestamp")
|
|
552
|
+
completed_at: str | None = Field(
|
|
553
|
+
default=None, description="ISO8601 completion timestamp"
|
|
554
|
+
)
|
|
555
|
+
output: GitHubCheckRunOutput | None = Field(
|
|
556
|
+
default=None, description="Check run output"
|
|
557
|
+
)
|
|
558
|
+
name: str = Field(description="Check run name")
|
|
559
|
+
check_suite: GitHubCheckSuite | None = Field(
|
|
560
|
+
default=None, description="Parent check suite"
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
class GitHubWorkflowRun(GitHubModel):
|
|
565
|
+
"""GitHub Actions workflow run."""
|
|
566
|
+
|
|
567
|
+
id: int = Field(description="Unique numeric ID")
|
|
568
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
569
|
+
name: str | None = Field(default=None, description="Workflow name")
|
|
570
|
+
head_branch: str | None = Field(default=None, description="Branch name")
|
|
571
|
+
head_sha: str = Field(description="Head commit SHA")
|
|
572
|
+
run_number: int = Field(description="Run number within workflow")
|
|
573
|
+
event: str = Field(description="Event that triggered the run")
|
|
574
|
+
status: str | None = Field(
|
|
575
|
+
default=None, description="Status: queued, in_progress, completed"
|
|
576
|
+
)
|
|
577
|
+
conclusion: str | None = Field(
|
|
578
|
+
default=None, description="Conclusion: success, failure, etc."
|
|
579
|
+
)
|
|
580
|
+
workflow_id: int = Field(description="Workflow ID")
|
|
581
|
+
url: str | None = Field(default=None, description="API URL")
|
|
582
|
+
html_url: str | None = Field(default=None, description="Web URL")
|
|
583
|
+
created_at: str | None = Field(
|
|
584
|
+
default=None, description="ISO8601 creation timestamp"
|
|
585
|
+
)
|
|
586
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
587
|
+
run_started_at: str | None = Field(
|
|
588
|
+
default=None, description="ISO8601 start timestamp"
|
|
589
|
+
)
|
|
590
|
+
actor: GitHubUser | None = Field(
|
|
591
|
+
default=None, description="User who triggered the run"
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
# =============================================================================
|
|
596
|
+
# Release Types
|
|
597
|
+
# =============================================================================
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
class GitHubReleaseAsset(GitHubModel):
|
|
601
|
+
"""Asset attached to a release."""
|
|
602
|
+
|
|
603
|
+
id: int = Field(description="Unique numeric ID")
|
|
604
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
605
|
+
name: str = Field(description="Asset filename")
|
|
606
|
+
label: str | None = Field(default=None, description="Asset label")
|
|
607
|
+
content_type: str = Field(description="MIME type")
|
|
608
|
+
state: str = Field(description="State: uploaded")
|
|
609
|
+
size: int = Field(description="File size in bytes")
|
|
610
|
+
download_count: int = Field(default=0, description="Number of downloads")
|
|
611
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
612
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
613
|
+
browser_download_url: str = Field(description="Download URL")
|
|
614
|
+
uploader: GitHubUser | None = Field(
|
|
615
|
+
default=None, description="User who uploaded the asset"
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
class GitHubRelease(GitHubModel):
|
|
620
|
+
"""GitHub release."""
|
|
621
|
+
|
|
622
|
+
id: int = Field(description="Unique numeric ID")
|
|
623
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
624
|
+
tag_name: str = Field(description="Git tag name")
|
|
625
|
+
target_commitish: str | None = Field(
|
|
626
|
+
default=None, description="Target commit/branch"
|
|
627
|
+
)
|
|
628
|
+
name: str | None = Field(default=None, description="Release name")
|
|
629
|
+
body: str | None = Field(default=None, description="Release notes")
|
|
630
|
+
draft: bool = Field(default=False, description="Whether release is a draft")
|
|
631
|
+
prerelease: bool = Field(
|
|
632
|
+
default=False, description="Whether release is a prerelease"
|
|
633
|
+
)
|
|
634
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
635
|
+
published_at: str | None = Field(
|
|
636
|
+
default=None, description="ISO8601 publish timestamp"
|
|
637
|
+
)
|
|
638
|
+
author: GitHubUser = Field(description="Release author")
|
|
639
|
+
html_url: str = Field(description="Web URL")
|
|
640
|
+
tarball_url: str | None = Field(default=None, description="Tarball URL")
|
|
641
|
+
zipball_url: str | None = Field(default=None, description="Zipball URL")
|
|
642
|
+
assets: list[GitHubReleaseAsset] = Field(
|
|
643
|
+
default_factory=list, description="Release assets"
|
|
644
|
+
)
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
# =============================================================================
|
|
648
|
+
# Requested Action / Workflow / Review Thread Types
|
|
649
|
+
# =============================================================================
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
class GitHubRequestedAction(GitHubModel):
|
|
653
|
+
"""Action requested by a user on a check run."""
|
|
654
|
+
|
|
655
|
+
identifier: str = Field(description="Identifier of the requested action")
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
class GitHubWorkflow(GitHubModel):
|
|
659
|
+
"""GitHub Actions workflow definition."""
|
|
660
|
+
|
|
661
|
+
id: int = Field(description="Unique numeric ID")
|
|
662
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
663
|
+
name: str = Field(description="Workflow name")
|
|
664
|
+
path: str = Field(description="Path to workflow file")
|
|
665
|
+
state: str = Field(description="Workflow state: active, disabled_manually, etc.")
|
|
666
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
667
|
+
updated_at: str = Field(description="ISO8601 update timestamp")
|
|
668
|
+
url: str = Field(description="API URL")
|
|
669
|
+
html_url: str = Field(description="Web URL")
|
|
670
|
+
badge_url: str | None = Field(default=None, description="Badge URL")
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
class GitHubWorkflowStep(GitHubModel):
|
|
674
|
+
"""A step in a GitHub Actions workflow job."""
|
|
675
|
+
|
|
676
|
+
name: str = Field(description="Step name")
|
|
677
|
+
status: str = Field(description="Status: queued, in_progress, completed")
|
|
678
|
+
conclusion: str | None = Field(
|
|
679
|
+
default=None, description="Conclusion: success, failure, skipped, etc."
|
|
680
|
+
)
|
|
681
|
+
number: int = Field(description="Step number")
|
|
682
|
+
started_at: str | None = Field(default=None, description="ISO8601 start timestamp")
|
|
683
|
+
completed_at: str | None = Field(
|
|
684
|
+
default=None, description="ISO8601 completion timestamp"
|
|
685
|
+
)
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
class GitHubWorkflowJob(GitHubModel):
|
|
689
|
+
"""A job in a GitHub Actions workflow run."""
|
|
690
|
+
|
|
691
|
+
id: int = Field(description="Unique numeric ID")
|
|
692
|
+
run_id: int = Field(description="Parent workflow run ID")
|
|
693
|
+
node_id: str | None = Field(default=None, description="GraphQL node ID")
|
|
694
|
+
head_sha: str = Field(description="Head commit SHA")
|
|
695
|
+
url: str | None = Field(default=None, description="API URL")
|
|
696
|
+
html_url: str | None = Field(default=None, description="Web URL")
|
|
697
|
+
status: str = Field(description="Status: queued, in_progress, completed")
|
|
698
|
+
conclusion: str | None = Field(
|
|
699
|
+
default=None, description="Conclusion: success, failure, etc."
|
|
700
|
+
)
|
|
701
|
+
started_at: str | None = Field(default=None, description="ISO8601 start timestamp")
|
|
702
|
+
completed_at: str | None = Field(
|
|
703
|
+
default=None, description="ISO8601 completion timestamp"
|
|
704
|
+
)
|
|
705
|
+
name: str = Field(description="Job name")
|
|
706
|
+
steps: list[GitHubWorkflowStep] = Field(
|
|
707
|
+
default_factory=list, description="Job steps"
|
|
708
|
+
)
|
|
709
|
+
runner_id: int | None = Field(default=None, description="Runner ID")
|
|
710
|
+
runner_name: str | None = Field(default=None, description="Runner name")
|
|
711
|
+
runner_group_id: int | None = Field(default=None, description="Runner group ID")
|
|
712
|
+
runner_group_name: str | None = Field(default=None, description="Runner group name")
|
|
713
|
+
workflow_name: str | None = Field(default=None, description="Parent workflow name")
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
class GitHubReviewThread(GitHubModel):
|
|
717
|
+
"""A pull request review thread."""
|
|
718
|
+
|
|
719
|
+
node_id: str = Field(description="GraphQL node ID")
|
|
720
|
+
comments: list[GitHubReviewComment] = Field(
|
|
721
|
+
default_factory=list, description="Comments in the thread"
|
|
722
|
+
)
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
# =============================================================================
|
|
726
|
+
# Changes Type (for edit events)
|
|
727
|
+
# =============================================================================
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
class GitHubChangeValue(GitHubModel):
|
|
731
|
+
"""A changed value in an edit event (contains the previous value)."""
|
|
732
|
+
|
|
733
|
+
# GitHub sends {"from": "old value"} for changed fields
|
|
734
|
+
from_: str = Field(alias="from", description="Previous value before the change")
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
class GitHubChanges(GitHubModel):
|
|
738
|
+
"""Changes made in an edit event."""
|
|
739
|
+
|
|
740
|
+
title: GitHubChangeValue | None = Field(
|
|
741
|
+
default=None, description="Title change with previous value"
|
|
742
|
+
)
|
|
743
|
+
body: GitHubChangeValue | None = Field(
|
|
744
|
+
default=None, description="Body change with previous value"
|
|
745
|
+
)
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
# =============================================================================
|
|
749
|
+
# Base GitHub Event Payload
|
|
750
|
+
# =============================================================================
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
class GitHubEventPayload(BasePayload, GitHubModel):
|
|
754
|
+
"""Base class for all GitHub webhook event payloads.
|
|
755
|
+
|
|
756
|
+
All GitHub event payloads share common fields: sender, repository,
|
|
757
|
+
organization (optional), and installation (for GitHub Apps).
|
|
758
|
+
|
|
759
|
+
Note: Inherits from both BasePayload (for dispatch compatibility)
|
|
760
|
+
and GitHubModel (for permissive extra field handling).
|
|
761
|
+
|
|
762
|
+
Subclasses should define `_dispatch_topic` as a ClassVar to specify
|
|
763
|
+
which topic they subscribe to.
|
|
764
|
+
"""
|
|
765
|
+
|
|
766
|
+
_dispatch_topic: ClassVar[str] = ""
|
|
767
|
+
|
|
768
|
+
sender: GitHubUser | None = Field(
|
|
769
|
+
default=None,
|
|
770
|
+
description="User who triggered the event (absent for some automated events)",
|
|
771
|
+
)
|
|
772
|
+
repository: GitHubRepository | None = Field(
|
|
773
|
+
default=None,
|
|
774
|
+
description="Repository where event occurred (absent for org-level events)",
|
|
775
|
+
)
|
|
776
|
+
organization: GitHubUser | None = Field(
|
|
777
|
+
default=None, description="Organization (only present for org-owned repos)"
|
|
778
|
+
)
|
|
779
|
+
|
|
780
|
+
@classmethod
|
|
781
|
+
def dispatch_topic(cls) -> str:
|
|
782
|
+
"""Return the topic string for this event type.
|
|
783
|
+
|
|
784
|
+
Raises:
|
|
785
|
+
NotImplementedError: If the class doesn't define _dispatch_topic.
|
|
786
|
+
"""
|
|
787
|
+
if not cls._dispatch_topic:
|
|
788
|
+
raise NotImplementedError(
|
|
789
|
+
f"{cls.__name__} must define _dispatch_topic to use dispatch_topic()"
|
|
790
|
+
)
|
|
791
|
+
return cls._dispatch_topic
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
# =============================================================================
|
|
795
|
+
# Pull Request Event Payloads
|
|
796
|
+
# =============================================================================
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
class PullRequestBase(GitHubEventPayload):
|
|
800
|
+
"""Base class for pull_request.* events.
|
|
801
|
+
|
|
802
|
+
Triggered when a pull request is:
|
|
803
|
+
- opened, closed, reopened
|
|
804
|
+
- edited (title/body changed)
|
|
805
|
+
- assigned, unassigned
|
|
806
|
+
- review_requested, review_request_removed
|
|
807
|
+
- labeled, unlabeled
|
|
808
|
+
- synchronized (new commits pushed)
|
|
809
|
+
- converted_to_draft, ready_for_review
|
|
810
|
+
- locked, unlocked
|
|
811
|
+
|
|
812
|
+
Use action-specific classes like PullRequestOpened, PullRequestClosed, etc.
|
|
813
|
+
for type-safe event handling with the @on decorator.
|
|
814
|
+
|
|
815
|
+
Example:
|
|
816
|
+
from dispatch_agents import on
|
|
817
|
+
from dispatch_agents.integrations.github import PullRequestOpened
|
|
818
|
+
|
|
819
|
+
@on(github_event=PullRequestOpened)
|
|
820
|
+
async def handle_pr_opened(payload: PullRequestOpened) -> None:
|
|
821
|
+
print(f"PR #{payload.number} opened by {payload.sender.login}")
|
|
822
|
+
"""
|
|
823
|
+
|
|
824
|
+
action: str = Field(description="Event action: opened, closed, synchronize, etc.")
|
|
825
|
+
number: int = Field(description="PR number")
|
|
826
|
+
pull_request: GitHubPullRequest = Field(description="Pull request data")
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
# =============================================================================
|
|
830
|
+
# Pull Request Action-Specific Classes
|
|
831
|
+
# =============================================================================
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
class PullRequestOpened(PullRequestBase):
|
|
835
|
+
"""Payload for github.pull_request.opened events."""
|
|
836
|
+
|
|
837
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.opened"
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
class PullRequestClosed(PullRequestBase):
|
|
841
|
+
"""Payload for github.pull_request.closed events."""
|
|
842
|
+
|
|
843
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.closed"
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
class PullRequestReopened(PullRequestBase):
|
|
847
|
+
"""Payload for github.pull_request.reopened events."""
|
|
848
|
+
|
|
849
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.reopened"
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
class PullRequestSynchronize(PullRequestBase):
|
|
853
|
+
"""Payload for github.pull_request.synchronize events."""
|
|
854
|
+
|
|
855
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.synchronize"
|
|
856
|
+
before: str = Field(description="Previous head SHA before the push")
|
|
857
|
+
after: str = Field(description="New head SHA after the push")
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
class PullRequestEdited(PullRequestBase):
|
|
861
|
+
"""Payload for github.pull_request.edited events."""
|
|
862
|
+
|
|
863
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.edited"
|
|
864
|
+
changes: GitHubChanges = Field(description="Changes made to the PR")
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
class PullRequestLabeled(PullRequestBase):
|
|
868
|
+
"""Payload for github.pull_request.labeled events."""
|
|
869
|
+
|
|
870
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.labeled"
|
|
871
|
+
label: GitHubLabel = Field(description="Label that was added")
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
class PullRequestUnlabeled(PullRequestBase):
|
|
875
|
+
"""Payload for github.pull_request.unlabeled events."""
|
|
876
|
+
|
|
877
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.unlabeled"
|
|
878
|
+
label: GitHubLabel = Field(description="Label that was removed")
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
class PullRequestAssigned(PullRequestBase):
|
|
882
|
+
"""Payload for github.pull_request.assigned events."""
|
|
883
|
+
|
|
884
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.assigned"
|
|
885
|
+
assignee: GitHubUser = Field(description="User who was assigned")
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
class PullRequestUnassigned(PullRequestBase):
|
|
889
|
+
"""Payload for github.pull_request.unassigned events."""
|
|
890
|
+
|
|
891
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.unassigned"
|
|
892
|
+
assignee: GitHubUser = Field(description="User who was unassigned")
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
class PullRequestReviewRequested(PullRequestBase):
|
|
896
|
+
"""Payload for github.pull_request.review_requested events."""
|
|
897
|
+
|
|
898
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.review_requested"
|
|
899
|
+
requested_reviewer: GitHubUser = Field(description="User requested for review")
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
class PullRequestReviewRequestRemoved(PullRequestBase):
|
|
903
|
+
"""Payload for github.pull_request.review_request_removed events."""
|
|
904
|
+
|
|
905
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.review_request_removed"
|
|
906
|
+
requested_reviewer: GitHubUser = Field(
|
|
907
|
+
description="User whose review request was removed"
|
|
908
|
+
)
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
class PullRequestReadyForReview(PullRequestBase):
|
|
912
|
+
"""Payload for github.pull_request.ready_for_review events."""
|
|
913
|
+
|
|
914
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.ready_for_review"
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
class PullRequestConvertedToDraft(PullRequestBase):
|
|
918
|
+
"""Payload for github.pull_request.converted_to_draft events."""
|
|
919
|
+
|
|
920
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.converted_to_draft"
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
class PullRequestLocked(PullRequestBase):
|
|
924
|
+
"""Payload for github.pull_request.locked events."""
|
|
925
|
+
|
|
926
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.locked"
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
class PullRequestUnlocked(PullRequestBase):
|
|
930
|
+
"""Payload for github.pull_request.unlocked events."""
|
|
931
|
+
|
|
932
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.unlocked"
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
class PullRequestMilestoned(PullRequestBase):
|
|
936
|
+
"""Payload for github.pull_request.milestoned events."""
|
|
937
|
+
|
|
938
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.milestoned"
|
|
939
|
+
milestone: GitHubMilestone = Field(description="Milestone added to the PR")
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
class PullRequestDemilestoned(PullRequestBase):
|
|
943
|
+
"""Payload for github.pull_request.demilestoned events."""
|
|
944
|
+
|
|
945
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.demilestoned"
|
|
946
|
+
milestone: GitHubMilestone = Field(description="Milestone removed from the PR")
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
class PullRequestAutoMergeEnabled(PullRequestBase):
|
|
950
|
+
"""Payload for github.pull_request.auto_merge_enabled events."""
|
|
951
|
+
|
|
952
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.auto_merge_enabled"
|
|
953
|
+
reason: str = Field(description="Reason auto-merge was enabled")
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
class PullRequestAutoMergeDisabled(PullRequestBase):
|
|
957
|
+
"""Payload for github.pull_request.auto_merge_disabled events."""
|
|
958
|
+
|
|
959
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.auto_merge_disabled"
|
|
960
|
+
reason: str = Field(description="Reason auto-merge was disabled")
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
class PullRequestEnqueued(PullRequestBase):
|
|
964
|
+
"""Payload for github.pull_request.enqueued events."""
|
|
965
|
+
|
|
966
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.enqueued"
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
class PullRequestDequeued(PullRequestBase):
|
|
970
|
+
"""Payload for github.pull_request.dequeued events."""
|
|
971
|
+
|
|
972
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request.dequeued"
|
|
973
|
+
reason: str = Field(description="Reason the pull request was dequeued")
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
class PullRequestReviewBase(GitHubEventPayload):
|
|
977
|
+
"""Base class for pull_request_review.* events.
|
|
978
|
+
|
|
979
|
+
Triggered when a pull request review is:
|
|
980
|
+
- submitted (includes approval, changes requested, or comment)
|
|
981
|
+
- edited
|
|
982
|
+
- dismissed
|
|
983
|
+
|
|
984
|
+
Use action-specific classes like PullRequestReviewSubmitted, etc.
|
|
985
|
+
"""
|
|
986
|
+
|
|
987
|
+
action: str = Field(description="Event action: submitted, edited, dismissed")
|
|
988
|
+
pull_request: GitHubPullRequest = Field(description="Pull request being reviewed")
|
|
989
|
+
review: GitHubReview = Field(description="Review data")
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
class PullRequestReviewSubmitted(PullRequestReviewBase):
|
|
993
|
+
"""Payload for github.pull_request_review.submitted events."""
|
|
994
|
+
|
|
995
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review.submitted"
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
class PullRequestReviewEdited(PullRequestReviewBase):
|
|
999
|
+
"""Payload for github.pull_request_review.edited events."""
|
|
1000
|
+
|
|
1001
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review.edited"
|
|
1002
|
+
changes: GitHubChanges = Field(description="Changes made to the review")
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
class PullRequestReviewDismissed(PullRequestReviewBase):
|
|
1006
|
+
"""Payload for github.pull_request_review.dismissed events."""
|
|
1007
|
+
|
|
1008
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review.dismissed"
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
class PullRequestReviewCommentBase(GitHubEventPayload):
|
|
1012
|
+
"""Base class for pull_request_review_comment.* events.
|
|
1013
|
+
|
|
1014
|
+
Triggered when a comment on a pull request diff is:
|
|
1015
|
+
- created
|
|
1016
|
+
- edited
|
|
1017
|
+
- deleted
|
|
1018
|
+
|
|
1019
|
+
Use action-specific classes like PullRequestReviewCommentCreated, etc.
|
|
1020
|
+
"""
|
|
1021
|
+
|
|
1022
|
+
action: str = Field(description="Event action: created, edited, deleted")
|
|
1023
|
+
pull_request: GitHubPullRequest = Field(description="Pull request")
|
|
1024
|
+
comment: GitHubReviewComment = Field(description="Review comment data")
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
class PullRequestReviewCommentCreated(PullRequestReviewCommentBase):
|
|
1028
|
+
"""Payload for github.pull_request_review_comment.created events."""
|
|
1029
|
+
|
|
1030
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review_comment.created"
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
class PullRequestReviewCommentEdited(PullRequestReviewCommentBase):
|
|
1034
|
+
"""Payload for github.pull_request_review_comment.edited events."""
|
|
1035
|
+
|
|
1036
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review_comment.edited"
|
|
1037
|
+
changes: GitHubChanges = Field(description="Changes made to the comment")
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
class PullRequestReviewCommentDeleted(PullRequestReviewCommentBase):
|
|
1041
|
+
"""Payload for github.pull_request_review_comment.deleted events."""
|
|
1042
|
+
|
|
1043
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review_comment.deleted"
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
class PullRequestReviewThreadBase(GitHubEventPayload):
|
|
1047
|
+
"""Base class for pull_request_review_thread.* events.
|
|
1048
|
+
|
|
1049
|
+
Triggered when a pull request review thread is:
|
|
1050
|
+
- resolved
|
|
1051
|
+
- unresolved
|
|
1052
|
+
|
|
1053
|
+
Use action-specific classes like PullRequestReviewThreadResolved, etc.
|
|
1054
|
+
"""
|
|
1055
|
+
|
|
1056
|
+
action: str = Field(description="Event action: resolved, unresolved")
|
|
1057
|
+
pull_request: GitHubPullRequest = Field(description="Pull request")
|
|
1058
|
+
thread: GitHubReviewThread = Field(description="Thread data")
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
class PullRequestReviewThreadResolved(PullRequestReviewThreadBase):
|
|
1062
|
+
"""Payload for github.pull_request_review_thread.resolved events."""
|
|
1063
|
+
|
|
1064
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review_thread.resolved"
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
class PullRequestReviewThreadUnresolved(PullRequestReviewThreadBase):
|
|
1068
|
+
"""Payload for github.pull_request_review_thread.unresolved events."""
|
|
1069
|
+
|
|
1070
|
+
_dispatch_topic: ClassVar[str] = "github.pull_request_review_thread.unresolved"
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
# =============================================================================
|
|
1074
|
+
# Issue Event Payloads
|
|
1075
|
+
# =============================================================================
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
class IssueBase(GitHubEventPayload):
|
|
1079
|
+
"""Base class for issues.* events.
|
|
1080
|
+
|
|
1081
|
+
Triggered when an issue is:
|
|
1082
|
+
- opened, closed, reopened, deleted
|
|
1083
|
+
- edited (title/body changed)
|
|
1084
|
+
- assigned, unassigned
|
|
1085
|
+
- labeled, unlabeled
|
|
1086
|
+
- pinned, unpinned
|
|
1087
|
+
- locked, unlocked
|
|
1088
|
+
- transferred
|
|
1089
|
+
- milestoned, demilestoned
|
|
1090
|
+
|
|
1091
|
+
Use action-specific classes like IssueOpened, IssueClosed, etc.
|
|
1092
|
+
"""
|
|
1093
|
+
|
|
1094
|
+
action: str = Field(description="Event action: opened, closed, edited, etc.")
|
|
1095
|
+
issue: GitHubIssue = Field(description="Issue data")
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
class IssueOpened(IssueBase):
|
|
1099
|
+
"""Payload for github.issues.opened events."""
|
|
1100
|
+
|
|
1101
|
+
_dispatch_topic: ClassVar[str] = "github.issues.opened"
|
|
1102
|
+
changes: GitHubChanges | None = Field(
|
|
1103
|
+
default=None, description="Changes made when issue was opened"
|
|
1104
|
+
)
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
class IssueClosed(IssueBase):
|
|
1108
|
+
"""Payload for github.issues.closed events."""
|
|
1109
|
+
|
|
1110
|
+
_dispatch_topic: ClassVar[str] = "github.issues.closed"
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
class IssueReopened(IssueBase):
|
|
1114
|
+
"""Payload for github.issues.reopened events."""
|
|
1115
|
+
|
|
1116
|
+
_dispatch_topic: ClassVar[str] = "github.issues.reopened"
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
class IssueEdited(IssueBase):
|
|
1120
|
+
"""Payload for github.issues.edited events."""
|
|
1121
|
+
|
|
1122
|
+
_dispatch_topic: ClassVar[str] = "github.issues.edited"
|
|
1123
|
+
changes: GitHubChanges = Field(description="Changes made to the issue")
|
|
1124
|
+
label: GitHubLabel | None = Field(
|
|
1125
|
+
default=None, description="Label associated with the edit"
|
|
1126
|
+
)
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
class IssueLabeled(IssueBase):
|
|
1130
|
+
"""Payload for github.issues.labeled events."""
|
|
1131
|
+
|
|
1132
|
+
_dispatch_topic: ClassVar[str] = "github.issues.labeled"
|
|
1133
|
+
label: GitHubLabel = Field(description="Label that was added")
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
class IssueUnlabeled(IssueBase):
|
|
1137
|
+
"""Payload for github.issues.unlabeled events."""
|
|
1138
|
+
|
|
1139
|
+
_dispatch_topic: ClassVar[str] = "github.issues.unlabeled"
|
|
1140
|
+
label: GitHubLabel = Field(description="Label that was removed")
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
class IssueAssigned(IssueBase):
|
|
1144
|
+
"""Payload for github.issues.assigned events."""
|
|
1145
|
+
|
|
1146
|
+
_dispatch_topic: ClassVar[str] = "github.issues.assigned"
|
|
1147
|
+
assignee: GitHubUser | None = Field(
|
|
1148
|
+
default=None, description="User who was assigned"
|
|
1149
|
+
)
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
class IssueUnassigned(IssueBase):
|
|
1153
|
+
"""Payload for github.issues.unassigned events."""
|
|
1154
|
+
|
|
1155
|
+
_dispatch_topic: ClassVar[str] = "github.issues.unassigned"
|
|
1156
|
+
assignee: GitHubUser | None = Field(
|
|
1157
|
+
default=None, description="User who was unassigned"
|
|
1158
|
+
)
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
class IssueMilestoned(IssueBase):
|
|
1162
|
+
"""Payload for github.issues.milestoned events."""
|
|
1163
|
+
|
|
1164
|
+
_dispatch_topic: ClassVar[str] = "github.issues.milestoned"
|
|
1165
|
+
milestone: GitHubMilestone = Field(description="Milestone added to the issue")
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
class IssueDemilestoned(IssueBase):
|
|
1169
|
+
"""Payload for github.issues.demilestoned events."""
|
|
1170
|
+
|
|
1171
|
+
_dispatch_topic: ClassVar[str] = "github.issues.demilestoned"
|
|
1172
|
+
milestone: GitHubMilestone = Field(description="Milestone removed from the issue")
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
class IssueLocked(IssueBase):
|
|
1176
|
+
"""Payload for github.issues.locked events."""
|
|
1177
|
+
|
|
1178
|
+
_dispatch_topic: ClassVar[str] = "github.issues.locked"
|
|
1179
|
+
|
|
1180
|
+
|
|
1181
|
+
class IssueUnlocked(IssueBase):
|
|
1182
|
+
"""Payload for github.issues.unlocked events."""
|
|
1183
|
+
|
|
1184
|
+
_dispatch_topic: ClassVar[str] = "github.issues.unlocked"
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
class IssueTransferred(IssueBase):
|
|
1188
|
+
"""Payload for github.issues.transferred events."""
|
|
1189
|
+
|
|
1190
|
+
_dispatch_topic: ClassVar[str] = "github.issues.transferred"
|
|
1191
|
+
changes: GitHubChanges = Field(description="Changes from the transfer")
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
class IssuePinned(IssueBase):
|
|
1195
|
+
"""Payload for github.issues.pinned events."""
|
|
1196
|
+
|
|
1197
|
+
_dispatch_topic: ClassVar[str] = "github.issues.pinned"
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
class IssueUnpinned(IssueBase):
|
|
1201
|
+
"""Payload for github.issues.unpinned events."""
|
|
1202
|
+
|
|
1203
|
+
_dispatch_topic: ClassVar[str] = "github.issues.unpinned"
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
class IssueDeleted(IssueBase):
|
|
1207
|
+
"""Payload for github.issues.deleted events."""
|
|
1208
|
+
|
|
1209
|
+
_dispatch_topic: ClassVar[str] = "github.issues.deleted"
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
class IssueCommentBase(GitHubEventPayload):
|
|
1213
|
+
"""Base class for issue_comment.* events.
|
|
1214
|
+
|
|
1215
|
+
Triggered when a comment on an issue or pull request is:
|
|
1216
|
+
- created
|
|
1217
|
+
- edited
|
|
1218
|
+
- deleted
|
|
1219
|
+
|
|
1220
|
+
Note: GitHub sends issue_comment events for both issues AND pull requests.
|
|
1221
|
+
Check issue.pull_request to determine if the comment is on a PR.
|
|
1222
|
+
|
|
1223
|
+
Use action-specific classes like IssueCommentCreated, etc.
|
|
1224
|
+
"""
|
|
1225
|
+
|
|
1226
|
+
action: str = Field(description="Event action: created, edited, deleted")
|
|
1227
|
+
issue: GitHubIssue = Field(description="Issue (or PR) being commented on")
|
|
1228
|
+
comment: GitHubComment = Field(description="Comment data")
|
|
1229
|
+
|
|
1230
|
+
@property
|
|
1231
|
+
def is_pull_request_comment(self) -> bool:
|
|
1232
|
+
"""Return True if this comment is on a pull request, not an issue."""
|
|
1233
|
+
return self.issue.pull_request is not None
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
class IssueCommentCreated(IssueCommentBase):
|
|
1237
|
+
"""Payload for github.issue_comment.created events."""
|
|
1238
|
+
|
|
1239
|
+
_dispatch_topic: ClassVar[str] = "github.issue_comment.created"
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
class IssueCommentEdited(IssueCommentBase):
|
|
1243
|
+
"""Payload for github.issue_comment.edited events."""
|
|
1244
|
+
|
|
1245
|
+
_dispatch_topic: ClassVar[str] = "github.issue_comment.edited"
|
|
1246
|
+
changes: GitHubChanges = Field(description="Changes made to the comment")
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
class IssueCommentDeleted(IssueCommentBase):
|
|
1250
|
+
"""Payload for github.issue_comment.deleted events."""
|
|
1251
|
+
|
|
1252
|
+
_dispatch_topic: ClassVar[str] = "github.issue_comment.deleted"
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
# =============================================================================
|
|
1256
|
+
# Push Event Payloads
|
|
1257
|
+
# =============================================================================
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
class Push(GitHubEventPayload):
|
|
1261
|
+
"""Payload for github.push events.
|
|
1262
|
+
|
|
1263
|
+
Triggered when commits are pushed to a repository branch or tag.
|
|
1264
|
+
This event has no action field.
|
|
1265
|
+
"""
|
|
1266
|
+
|
|
1267
|
+
_dispatch_topic: ClassVar[str] = "github.push"
|
|
1268
|
+
|
|
1269
|
+
ref: str = Field(description="Git ref (e.g., refs/heads/main)")
|
|
1270
|
+
before: str = Field(description="SHA before the push")
|
|
1271
|
+
after: str = Field(description="SHA after the push")
|
|
1272
|
+
created: bool = Field(default=False, description="Whether the ref was created")
|
|
1273
|
+
deleted: bool = Field(default=False, description="Whether the ref was deleted")
|
|
1274
|
+
forced: bool = Field(default=False, description="Whether the push was a force push")
|
|
1275
|
+
base_ref: str | None = Field(
|
|
1276
|
+
default=None, description="Base ref for branch creation"
|
|
1277
|
+
)
|
|
1278
|
+
compare: str = Field(description="URL comparing before/after")
|
|
1279
|
+
commits: list[GitHubCommit] = Field(
|
|
1280
|
+
default_factory=list, description="Commits pushed"
|
|
1281
|
+
)
|
|
1282
|
+
head_commit: GitHubCommit | None = Field(default=None, description="Head commit")
|
|
1283
|
+
pusher: GitHubCommitUser = Field(description="User who pushed")
|
|
1284
|
+
|
|
1285
|
+
@property
|
|
1286
|
+
def branch(self) -> str | None:
|
|
1287
|
+
"""Extract branch name from ref (e.g., 'main' from 'refs/heads/main')."""
|
|
1288
|
+
if self.ref.startswith("refs/heads/"):
|
|
1289
|
+
return self.ref[11:]
|
|
1290
|
+
return None
|
|
1291
|
+
|
|
1292
|
+
@property
|
|
1293
|
+
def tag(self) -> str | None:
|
|
1294
|
+
"""Extract tag name from ref (e.g., 'v1.0.0' from 'refs/tags/v1.0.0')."""
|
|
1295
|
+
if self.ref.startswith("refs/tags/"):
|
|
1296
|
+
return self.ref[10:]
|
|
1297
|
+
return None
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
# =============================================================================
|
|
1301
|
+
# Check Run / Workflow Event Payloads
|
|
1302
|
+
# =============================================================================
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
class CheckRunBase(GitHubEventPayload):
|
|
1306
|
+
"""Base class for check_run.* events.
|
|
1307
|
+
|
|
1308
|
+
Triggered when a check run is:
|
|
1309
|
+
- created
|
|
1310
|
+
- completed
|
|
1311
|
+
- rerequested
|
|
1312
|
+
- requested_action
|
|
1313
|
+
|
|
1314
|
+
Use action-specific classes like CheckRunCreated, CheckRunCompleted, etc.
|
|
1315
|
+
"""
|
|
1316
|
+
|
|
1317
|
+
action: str = Field(
|
|
1318
|
+
description="Event action: created, completed, rerequested, requested_action"
|
|
1319
|
+
)
|
|
1320
|
+
check_run: GitHubCheckRun = Field(description="Check run data")
|
|
1321
|
+
requested_action: GitHubRequestedAction | None = Field(
|
|
1322
|
+
default=None, description="Requested action if action is 'requested_action'"
|
|
1323
|
+
)
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
class CheckRunCreated(CheckRunBase):
|
|
1327
|
+
"""Payload for github.check_run.created events."""
|
|
1328
|
+
|
|
1329
|
+
_dispatch_topic: ClassVar[str] = "github.check_run.created"
|
|
1330
|
+
|
|
1331
|
+
|
|
1332
|
+
class CheckRunCompleted(CheckRunBase):
|
|
1333
|
+
"""Payload for github.check_run.completed events."""
|
|
1334
|
+
|
|
1335
|
+
_dispatch_topic: ClassVar[str] = "github.check_run.completed"
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
class CheckRunRerequested(CheckRunBase):
|
|
1339
|
+
"""Payload for github.check_run.rerequested events."""
|
|
1340
|
+
|
|
1341
|
+
_dispatch_topic: ClassVar[str] = "github.check_run.rerequested"
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
class CheckRunRequestedAction(CheckRunBase):
|
|
1345
|
+
"""Payload for github.check_run.requested_action events."""
|
|
1346
|
+
|
|
1347
|
+
_dispatch_topic: ClassVar[str] = "github.check_run.requested_action"
|
|
1348
|
+
requested_action: GitHubRequestedAction = Field(
|
|
1349
|
+
description="The action requested by the user"
|
|
1350
|
+
)
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
class CheckSuiteBase(GitHubEventPayload):
|
|
1354
|
+
"""Base class for check_suite.* events.
|
|
1355
|
+
|
|
1356
|
+
Triggered when a check suite is:
|
|
1357
|
+
- completed
|
|
1358
|
+
- requested
|
|
1359
|
+
- rerequested
|
|
1360
|
+
|
|
1361
|
+
Use action-specific classes like CheckSuiteCompleted, etc.
|
|
1362
|
+
"""
|
|
1363
|
+
|
|
1364
|
+
action: str = Field(description="Event action: completed, requested, rerequested")
|
|
1365
|
+
check_suite: GitHubCheckSuite = Field(description="Check suite data")
|
|
1366
|
+
|
|
1367
|
+
|
|
1368
|
+
class CheckSuiteCompleted(CheckSuiteBase):
|
|
1369
|
+
"""Payload for github.check_suite.completed events."""
|
|
1370
|
+
|
|
1371
|
+
_dispatch_topic: ClassVar[str] = "github.check_suite.completed"
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
class CheckSuiteRequested(CheckSuiteBase):
|
|
1375
|
+
"""Payload for github.check_suite.requested events."""
|
|
1376
|
+
|
|
1377
|
+
_dispatch_topic: ClassVar[str] = "github.check_suite.requested"
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
class CheckSuiteRerequested(CheckSuiteBase):
|
|
1381
|
+
"""Payload for github.check_suite.rerequested events."""
|
|
1382
|
+
|
|
1383
|
+
_dispatch_topic: ClassVar[str] = "github.check_suite.rerequested"
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
class WorkflowRunBase(GitHubEventPayload):
|
|
1387
|
+
"""Base class for workflow_run.* events.
|
|
1388
|
+
|
|
1389
|
+
Triggered when a GitHub Actions workflow run is:
|
|
1390
|
+
- requested (queued)
|
|
1391
|
+
- in_progress
|
|
1392
|
+
- completed
|
|
1393
|
+
|
|
1394
|
+
Use action-specific classes like WorkflowRunCompleted, etc.
|
|
1395
|
+
"""
|
|
1396
|
+
|
|
1397
|
+
action: str = Field(description="Event action: requested, in_progress, completed")
|
|
1398
|
+
workflow_run: GitHubWorkflowRun = Field(description="Workflow run data")
|
|
1399
|
+
workflow: GitHubWorkflow = Field(description="Workflow definition")
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
class WorkflowRunRequested(WorkflowRunBase):
|
|
1403
|
+
"""Payload for github.workflow_run.requested events."""
|
|
1404
|
+
|
|
1405
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_run.requested"
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
class WorkflowRunInProgress(WorkflowRunBase):
|
|
1409
|
+
"""Payload for github.workflow_run.in_progress events."""
|
|
1410
|
+
|
|
1411
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_run.in_progress"
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
class WorkflowRunCompleted(WorkflowRunBase):
|
|
1415
|
+
"""Payload for github.workflow_run.completed events."""
|
|
1416
|
+
|
|
1417
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_run.completed"
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
class WorkflowJobBase(GitHubEventPayload):
|
|
1421
|
+
"""Base class for workflow_job.* events.
|
|
1422
|
+
|
|
1423
|
+
Triggered when a GitHub Actions workflow job is:
|
|
1424
|
+
- queued
|
|
1425
|
+
- in_progress
|
|
1426
|
+
- completed
|
|
1427
|
+
- waiting
|
|
1428
|
+
|
|
1429
|
+
Use action-specific classes like WorkflowJobCompleted, etc.
|
|
1430
|
+
"""
|
|
1431
|
+
|
|
1432
|
+
action: str = Field(
|
|
1433
|
+
description="Event action: queued, in_progress, completed, waiting"
|
|
1434
|
+
)
|
|
1435
|
+
workflow_job: GitHubWorkflowJob = Field(description="Workflow job data")
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
class WorkflowJobQueued(WorkflowJobBase):
|
|
1439
|
+
"""Payload for github.workflow_job.queued events."""
|
|
1440
|
+
|
|
1441
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_job.queued"
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
class WorkflowJobInProgress(WorkflowJobBase):
|
|
1445
|
+
"""Payload for github.workflow_job.in_progress events."""
|
|
1446
|
+
|
|
1447
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_job.in_progress"
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
class WorkflowJobCompleted(WorkflowJobBase):
|
|
1451
|
+
"""Payload for github.workflow_job.completed events."""
|
|
1452
|
+
|
|
1453
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_job.completed"
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
class WorkflowJobWaiting(WorkflowJobBase):
|
|
1457
|
+
"""Payload for github.workflow_job.waiting events."""
|
|
1458
|
+
|
|
1459
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_job.waiting"
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
# =============================================================================
|
|
1463
|
+
# Deployment Event Payloads
|
|
1464
|
+
# =============================================================================
|
|
1465
|
+
|
|
1466
|
+
|
|
1467
|
+
class GitHubDeployment(GitHubModel):
|
|
1468
|
+
"""GitHub deployment object."""
|
|
1469
|
+
|
|
1470
|
+
id: int = Field(description="Unique numeric ID of the deployment")
|
|
1471
|
+
sha: str = Field(description="SHA of the commit that is being deployed")
|
|
1472
|
+
ref: str = Field(description="Ref (branch or tag) that was deployed")
|
|
1473
|
+
task: str = Field(description="Task name, e.g. 'deploy' or 'deploy:migrations'")
|
|
1474
|
+
environment: str = Field(description="Name of the target deployment environment")
|
|
1475
|
+
description: str | None = Field(
|
|
1476
|
+
default=None, description="Optional description of the deployment"
|
|
1477
|
+
)
|
|
1478
|
+
creator: GitHubUser | None = Field(
|
|
1479
|
+
default=None, description="User who created the deployment"
|
|
1480
|
+
)
|
|
1481
|
+
created_at: str = Field(
|
|
1482
|
+
description="ISO8601 timestamp when the deployment was created"
|
|
1483
|
+
)
|
|
1484
|
+
updated_at: str = Field(
|
|
1485
|
+
description="ISO8601 timestamp when the deployment was last updated"
|
|
1486
|
+
)
|
|
1487
|
+
statuses_url: str = Field(
|
|
1488
|
+
description="API URL to list statuses for this deployment"
|
|
1489
|
+
)
|
|
1490
|
+
repository_url: str = Field(description="API URL of the repository")
|
|
1491
|
+
url: str = Field(description="API URL of the deployment")
|
|
1492
|
+
payload: dict[str, Any] = Field(
|
|
1493
|
+
default_factory=dict, description="Extra information sent to the deployment"
|
|
1494
|
+
)
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
class DeploymentBase(GitHubEventPayload):
|
|
1498
|
+
"""Base class for deployment.* events.
|
|
1499
|
+
|
|
1500
|
+
Triggered when a deployment is created.
|
|
1501
|
+
Use action-specific classes like DeploymentCreated.
|
|
1502
|
+
"""
|
|
1503
|
+
|
|
1504
|
+
action: str = Field(description="Event action, e.g. 'created'")
|
|
1505
|
+
deployment: GitHubDeployment = Field(description="Deployment object")
|
|
1506
|
+
workflow: GitHubWorkflow | None = Field(
|
|
1507
|
+
default=None, description="Workflow that triggered the deployment, if any"
|
|
1508
|
+
)
|
|
1509
|
+
workflow_run: GitHubWorkflowRun | None = Field(
|
|
1510
|
+
default=None, description="Workflow run that triggered the deployment, if any"
|
|
1511
|
+
)
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
class DeploymentCreated(DeploymentBase):
|
|
1515
|
+
"""Payload for github.deployment.created events."""
|
|
1516
|
+
|
|
1517
|
+
_dispatch_topic: ClassVar[str] = "github.deployment.created"
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
# =============================================================================
|
|
1521
|
+
# Deployment Status Event Payloads
|
|
1522
|
+
# =============================================================================
|
|
1523
|
+
|
|
1524
|
+
|
|
1525
|
+
class GitHubDeploymentStatus(GitHubModel):
|
|
1526
|
+
"""GitHub deployment status object."""
|
|
1527
|
+
|
|
1528
|
+
id: int = Field(description="Unique numeric ID of the deployment status")
|
|
1529
|
+
state: str = Field(
|
|
1530
|
+
description="State of the deployment status, e.g. 'pending', 'success', 'failure', 'error', 'inactive', 'in_progress', 'queued', 'waiting'"
|
|
1531
|
+
)
|
|
1532
|
+
description: str | None = Field(
|
|
1533
|
+
default=None, description="Optional short description of the status"
|
|
1534
|
+
)
|
|
1535
|
+
environment: str = Field(
|
|
1536
|
+
description="Name of the target deployment environment for the status"
|
|
1537
|
+
)
|
|
1538
|
+
target_url: str | None = Field(
|
|
1539
|
+
default=None,
|
|
1540
|
+
description="URL associated with the status, e.g. a CI build URL",
|
|
1541
|
+
)
|
|
1542
|
+
created_at: str = Field(
|
|
1543
|
+
description="ISO8601 timestamp when the deployment status was created"
|
|
1544
|
+
)
|
|
1545
|
+
updated_at: str = Field(
|
|
1546
|
+
description="ISO8601 timestamp when the deployment status was last updated"
|
|
1547
|
+
)
|
|
1548
|
+
deployment_url: str = Field(description="API URL of the associated deployment")
|
|
1549
|
+
repository_url: str = Field(description="API URL of the repository")
|
|
1550
|
+
|
|
1551
|
+
|
|
1552
|
+
class DeploymentStatusBase(GitHubEventPayload):
|
|
1553
|
+
"""Base class for deployment_status.* events.
|
|
1554
|
+
|
|
1555
|
+
Triggered when a deployment status is created.
|
|
1556
|
+
Use action-specific classes like DeploymentStatusCreated.
|
|
1557
|
+
"""
|
|
1558
|
+
|
|
1559
|
+
action: str = Field(description="Event action, e.g. 'created'")
|
|
1560
|
+
deployment_status: GitHubDeploymentStatus = Field(
|
|
1561
|
+
description="Deployment status object"
|
|
1562
|
+
)
|
|
1563
|
+
deployment: GitHubDeployment = Field(
|
|
1564
|
+
description="Deployment associated with the status"
|
|
1565
|
+
)
|
|
1566
|
+
|
|
1567
|
+
|
|
1568
|
+
class DeploymentStatusCreated(DeploymentStatusBase):
|
|
1569
|
+
"""Payload for github.deployment_status.created events."""
|
|
1570
|
+
|
|
1571
|
+
_dispatch_topic: ClassVar[str] = "github.deployment_status.created"
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
# =============================================================================
|
|
1575
|
+
# Deployment Review Event Payloads
|
|
1576
|
+
# =============================================================================
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
class DeploymentReviewBase(GitHubEventPayload):
|
|
1580
|
+
"""Base class for deployment_review.* events.
|
|
1581
|
+
|
|
1582
|
+
Triggered when a deployment review is approved, rejected, or requested.
|
|
1583
|
+
This is a GitHub Apps/Environments-specific event.
|
|
1584
|
+
Use action-specific classes like DeploymentReviewApproved, etc.
|
|
1585
|
+
"""
|
|
1586
|
+
|
|
1587
|
+
action: str = Field(
|
|
1588
|
+
description="Event action, e.g. 'approved', 'rejected', 'requested'"
|
|
1589
|
+
)
|
|
1590
|
+
# workflow_run and reviewers use dict[str, Any] rather than typed models because
|
|
1591
|
+
# the deployment_review webhook delivers a stripped-down workflow run shape that
|
|
1592
|
+
# differs from GitHubWorkflowRun (missing many standard fields).
|
|
1593
|
+
workflow_run: dict[str, Any] | None = Field(
|
|
1594
|
+
description="Workflow run associated with the deployment review"
|
|
1595
|
+
)
|
|
1596
|
+
since: str = Field(
|
|
1597
|
+
description="ISO8601 timestamp indicating the start of the review period"
|
|
1598
|
+
)
|
|
1599
|
+
environment: str | None = Field(
|
|
1600
|
+
default=None, description="Name of the environment being reviewed"
|
|
1601
|
+
)
|
|
1602
|
+
workflow_job_run: dict[str, Any] | None = Field(
|
|
1603
|
+
default=None,
|
|
1604
|
+
description="Workflow job run associated with the deployment review",
|
|
1605
|
+
)
|
|
1606
|
+
reviewers: list[dict[str, Any]] | None = Field(
|
|
1607
|
+
default=None,
|
|
1608
|
+
description="List of reviewers (users or teams) for the deployment",
|
|
1609
|
+
)
|
|
1610
|
+
requester: GitHubUser | None = Field(
|
|
1611
|
+
default=None,
|
|
1612
|
+
alias="requestor",
|
|
1613
|
+
description="User who requested the deployment review",
|
|
1614
|
+
)
|
|
1615
|
+
reviewer: GitHubUser | None = Field(
|
|
1616
|
+
default=None, description="The user who reviewed the deployment"
|
|
1617
|
+
)
|
|
1618
|
+
comment: str | None = Field(
|
|
1619
|
+
default=None, description="Comment left by the reviewer"
|
|
1620
|
+
)
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
class DeploymentReviewApproved(DeploymentReviewBase):
|
|
1624
|
+
"""Payload for github.deployment_review.approved events."""
|
|
1625
|
+
|
|
1626
|
+
_dispatch_topic: ClassVar[str] = "github.deployment_review.approved"
|
|
1627
|
+
|
|
1628
|
+
|
|
1629
|
+
class DeploymentReviewRejected(DeploymentReviewBase):
|
|
1630
|
+
"""Payload for github.deployment_review.rejected events."""
|
|
1631
|
+
|
|
1632
|
+
_dispatch_topic: ClassVar[str] = "github.deployment_review.rejected"
|
|
1633
|
+
|
|
1634
|
+
|
|
1635
|
+
class DeploymentReviewRequested(DeploymentReviewBase):
|
|
1636
|
+
"""Payload for github.deployment_review.requested events."""
|
|
1637
|
+
|
|
1638
|
+
_dispatch_topic: ClassVar[str] = "github.deployment_review.requested"
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
# =============================================================================
|
|
1642
|
+
# Commit Status Event Payload
|
|
1643
|
+
# =============================================================================
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
class GitHubStatusCommit(GitHubModel):
|
|
1647
|
+
"""Commit object embedded in a commit status event."""
|
|
1648
|
+
|
|
1649
|
+
sha: str = Field(description="The commit SHA")
|
|
1650
|
+
url: str = Field(description="API URL for the commit")
|
|
1651
|
+
html_url: str = Field(description="Web URL for the commit")
|
|
1652
|
+
commit: dict[str, Any] = Field(
|
|
1653
|
+
description="Commit data including message and author"
|
|
1654
|
+
)
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
class CommitStatus(GitHubEventPayload):
|
|
1658
|
+
"""Payload for github.status events (commit status updates).
|
|
1659
|
+
|
|
1660
|
+
Triggered when the status of a Git commit changes. This event has no
|
|
1661
|
+
action field — it fires directly when a commit status is created or updated.
|
|
1662
|
+
"""
|
|
1663
|
+
|
|
1664
|
+
_dispatch_topic: ClassVar[str] = "github.status"
|
|
1665
|
+
|
|
1666
|
+
id: int = Field(description="Unique numeric ID of the status event")
|
|
1667
|
+
sha: str = Field(description="The commit SHA the status applies to")
|
|
1668
|
+
name: str = Field(description="Repository name")
|
|
1669
|
+
target_url: str | None = Field(
|
|
1670
|
+
default=None, description="URL associated with the status (e.g. CI build URL)"
|
|
1671
|
+
)
|
|
1672
|
+
context: str = Field(
|
|
1673
|
+
description="Identifier for the status check (e.g. 'ci/circleci')"
|
|
1674
|
+
)
|
|
1675
|
+
description: str | None = Field(
|
|
1676
|
+
default=None, description="Short human-readable description of the status"
|
|
1677
|
+
)
|
|
1678
|
+
state: str = Field(
|
|
1679
|
+
description="State of the status: error, failure, pending, or success"
|
|
1680
|
+
)
|
|
1681
|
+
commit: GitHubStatusCommit = Field(
|
|
1682
|
+
description="The commit object associated with this status"
|
|
1683
|
+
)
|
|
1684
|
+
branches: list[dict[str, Any]] = Field(
|
|
1685
|
+
description="List of branches containing the commit SHA"
|
|
1686
|
+
)
|
|
1687
|
+
created_at: str = Field(description="ISO8601 timestamp when the status was created")
|
|
1688
|
+
updated_at: str = Field(
|
|
1689
|
+
description="ISO8601 timestamp when the status was last updated"
|
|
1690
|
+
)
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
# =============================================================================
|
|
1694
|
+
# WorkflowDispatch Event Payload
|
|
1695
|
+
# =============================================================================
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
class WorkflowDispatch(GitHubEventPayload):
|
|
1699
|
+
"""Payload for github.workflow_dispatch events.
|
|
1700
|
+
|
|
1701
|
+
Triggered when a workflow is manually dispatched via the GitHub UI or
|
|
1702
|
+
the API. This event has no action field — it fires directly when the
|
|
1703
|
+
workflow dispatch occurs.
|
|
1704
|
+
"""
|
|
1705
|
+
|
|
1706
|
+
_dispatch_topic: ClassVar[str] = "github.workflow_dispatch"
|
|
1707
|
+
|
|
1708
|
+
workflow: str = Field(description="Path to the workflow file that was dispatched")
|
|
1709
|
+
ref: str = Field(
|
|
1710
|
+
description="The branch or tag ref that the workflow was dispatched on"
|
|
1711
|
+
)
|
|
1712
|
+
inputs: dict[str, Any] | None = Field(
|
|
1713
|
+
default=None,
|
|
1714
|
+
description="Input parameters provided when the workflow was dispatched",
|
|
1715
|
+
)
|
|
1716
|
+
|
|
1717
|
+
|
|
1718
|
+
# =============================================================================
|
|
1719
|
+
# Dependabot Alert Event Payloads
|
|
1720
|
+
# =============================================================================
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
class GitHubDependabotDependency(GitHubModel):
|
|
1724
|
+
"""Dependency information for a Dependabot alert."""
|
|
1725
|
+
|
|
1726
|
+
package: dict[str, Any] = Field(
|
|
1727
|
+
description="Package details including ecosystem and name sub-keys"
|
|
1728
|
+
)
|
|
1729
|
+
manifest_path: str = Field(
|
|
1730
|
+
description="Path to the manifest file where the dependency is declared"
|
|
1731
|
+
)
|
|
1732
|
+
scope: str | None = Field(
|
|
1733
|
+
default=None, description="Dependency scope: runtime, development, or null"
|
|
1734
|
+
)
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
class GitHubDependabotAdvisory(GitHubModel):
|
|
1738
|
+
"""Security advisory associated with a Dependabot alert."""
|
|
1739
|
+
|
|
1740
|
+
ghsa_id: str = Field(description="GitHub Security Advisory identifier")
|
|
1741
|
+
cve_id: str | None = Field(
|
|
1742
|
+
default=None, description="CVE identifier, if applicable"
|
|
1743
|
+
)
|
|
1744
|
+
summary: str = Field(description="Short summary of the advisory")
|
|
1745
|
+
description: str = Field(description="Full description of the advisory")
|
|
1746
|
+
severity: str = Field(
|
|
1747
|
+
description="Severity level: low, moderate, high, or critical"
|
|
1748
|
+
)
|
|
1749
|
+
cvss: dict[str, Any] = Field(description="CVSS score and vector string details")
|
|
1750
|
+
cwes: list[dict[str, Any]] = Field(description="CWE weakness identifiers")
|
|
1751
|
+
identifiers: list[dict[str, Any]] = Field(
|
|
1752
|
+
description="External identifiers for the advisory"
|
|
1753
|
+
)
|
|
1754
|
+
references: list[dict[str, Any]] = Field(
|
|
1755
|
+
description="External references for the advisory"
|
|
1756
|
+
)
|
|
1757
|
+
published_at: str = Field(
|
|
1758
|
+
description="ISO8601 timestamp when the advisory was published"
|
|
1759
|
+
)
|
|
1760
|
+
updated_at: str = Field(
|
|
1761
|
+
description="ISO8601 timestamp when the advisory was last updated"
|
|
1762
|
+
)
|
|
1763
|
+
withdrawn_at: str | None = Field(
|
|
1764
|
+
default=None,
|
|
1765
|
+
description="ISO8601 timestamp when the advisory was withdrawn, if applicable",
|
|
1766
|
+
)
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
class GitHubDependabotVulnerability(GitHubModel):
|
|
1770
|
+
"""Vulnerability details within a security advisory for a specific package."""
|
|
1771
|
+
|
|
1772
|
+
package: dict[str, Any] = Field(
|
|
1773
|
+
description="Package details including ecosystem and name"
|
|
1774
|
+
)
|
|
1775
|
+
severity: str = Field(
|
|
1776
|
+
description="Severity level: low, moderate, high, or critical"
|
|
1777
|
+
)
|
|
1778
|
+
vulnerable_version_range: str = Field(
|
|
1779
|
+
description="Version range that is affected by the vulnerability"
|
|
1780
|
+
)
|
|
1781
|
+
first_patched_version: dict[str, Any] | None = Field(
|
|
1782
|
+
default=None,
|
|
1783
|
+
description="First version that includes a fix for the vulnerability, or null if unpatched",
|
|
1784
|
+
)
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
class GitHubDependabotAlert(GitHubModel):
|
|
1788
|
+
"""A Dependabot security alert for a repository."""
|
|
1789
|
+
|
|
1790
|
+
number: int = Field(description="Alert number within the repository")
|
|
1791
|
+
state: str = Field(
|
|
1792
|
+
description="Alert state: open, dismissed, fixed, or auto_dismissed"
|
|
1793
|
+
)
|
|
1794
|
+
dependency: GitHubDependabotDependency = Field(
|
|
1795
|
+
description="The dependency associated with the alert"
|
|
1796
|
+
)
|
|
1797
|
+
security_advisory: GitHubDependabotAdvisory = Field(
|
|
1798
|
+
description="The security advisory that triggered the alert"
|
|
1799
|
+
)
|
|
1800
|
+
security_vulnerability: GitHubDependabotVulnerability = Field(
|
|
1801
|
+
description="The specific vulnerability within the advisory for this dependency"
|
|
1802
|
+
)
|
|
1803
|
+
url: str = Field(description="REST API URL for this alert")
|
|
1804
|
+
html_url: str = Field(description="Web URL for this alert")
|
|
1805
|
+
created_at: str = Field(description="ISO8601 timestamp when the alert was created")
|
|
1806
|
+
updated_at: str = Field(
|
|
1807
|
+
description="ISO8601 timestamp when the alert was last updated"
|
|
1808
|
+
)
|
|
1809
|
+
dismissed_at: str | None = Field(
|
|
1810
|
+
default=None,
|
|
1811
|
+
description="ISO8601 timestamp when the alert was dismissed, if applicable",
|
|
1812
|
+
)
|
|
1813
|
+
dismissed_by: GitHubUser | None = Field(
|
|
1814
|
+
default=None, description="User who dismissed the alert, if applicable"
|
|
1815
|
+
)
|
|
1816
|
+
dismissed_reason: str | None = Field(
|
|
1817
|
+
default=None,
|
|
1818
|
+
description="Reason for dismissal: tolerable_risk, no_bandwidth, inaccurate, not_used, or null",
|
|
1819
|
+
)
|
|
1820
|
+
dismissed_comment: str | None = Field(
|
|
1821
|
+
default=None, description="Comment provided when dismissing the alert"
|
|
1822
|
+
)
|
|
1823
|
+
fixed_at: str | None = Field(
|
|
1824
|
+
default=None,
|
|
1825
|
+
description="ISO8601 timestamp when the alert was fixed, if applicable",
|
|
1826
|
+
)
|
|
1827
|
+
auto_dismissed_at: str | None = Field(
|
|
1828
|
+
default=None,
|
|
1829
|
+
description="ISO8601 timestamp when the alert was auto-dismissed, if applicable",
|
|
1830
|
+
)
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
class DependabotAlertBase(GitHubEventPayload):
|
|
1834
|
+
"""Base class for dependabot_alert.* events.
|
|
1835
|
+
|
|
1836
|
+
Triggered when a Dependabot alert is:
|
|
1837
|
+
- created
|
|
1838
|
+
- fixed
|
|
1839
|
+
- dismissed
|
|
1840
|
+
- reintroduced
|
|
1841
|
+
- auto_dismissed
|
|
1842
|
+
- auto_reopened
|
|
1843
|
+
- reopened
|
|
1844
|
+
|
|
1845
|
+
Use action-specific classes like DependabotAlertCreated, etc.
|
|
1846
|
+
"""
|
|
1847
|
+
|
|
1848
|
+
action: str = Field(
|
|
1849
|
+
description="Event action: created, fixed, dismissed, reintroduced, auto_dismissed, auto_reopened, or reopened"
|
|
1850
|
+
)
|
|
1851
|
+
alert: GitHubDependabotAlert = Field(
|
|
1852
|
+
description="The Dependabot alert that triggered the event"
|
|
1853
|
+
)
|
|
1854
|
+
|
|
1855
|
+
|
|
1856
|
+
class DependabotAlertCreated(DependabotAlertBase):
|
|
1857
|
+
"""Payload for github.dependabot_alert.created events."""
|
|
1858
|
+
|
|
1859
|
+
_dispatch_topic: ClassVar[str] = "github.dependabot_alert.created"
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
class DependabotAlertFixed(DependabotAlertBase):
|
|
1863
|
+
"""Payload for github.dependabot_alert.fixed events."""
|
|
1864
|
+
|
|
1865
|
+
_dispatch_topic: ClassVar[str] = "github.dependabot_alert.fixed"
|
|
1866
|
+
|
|
1867
|
+
|
|
1868
|
+
class DependabotAlertDismissed(DependabotAlertBase):
|
|
1869
|
+
"""Payload for github.dependabot_alert.dismissed events."""
|
|
1870
|
+
|
|
1871
|
+
_dispatch_topic: ClassVar[str] = "github.dependabot_alert.dismissed"
|
|
1872
|
+
|
|
1873
|
+
|
|
1874
|
+
class DependabotAlertReintroduced(DependabotAlertBase):
|
|
1875
|
+
"""Payload for github.dependabot_alert.reintroduced events."""
|
|
1876
|
+
|
|
1877
|
+
_dispatch_topic: ClassVar[str] = "github.dependabot_alert.reintroduced"
|
|
1878
|
+
|
|
1879
|
+
|
|
1880
|
+
class DependabotAlertAutoDismissed(DependabotAlertBase):
|
|
1881
|
+
"""Payload for github.dependabot_alert.auto_dismissed events."""
|
|
1882
|
+
|
|
1883
|
+
_dispatch_topic: ClassVar[str] = "github.dependabot_alert.auto_dismissed"
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
class DependabotAlertAutoReopened(DependabotAlertBase):
|
|
1887
|
+
"""Payload for github.dependabot_alert.auto_reopened events."""
|
|
1888
|
+
|
|
1889
|
+
_dispatch_topic: ClassVar[str] = "github.dependabot_alert.auto_reopened"
|
|
1890
|
+
|
|
1891
|
+
|
|
1892
|
+
class DependabotAlertReopened(DependabotAlertBase):
|
|
1893
|
+
"""Payload for github.dependabot_alert.reopened events."""
|
|
1894
|
+
|
|
1895
|
+
_dispatch_topic: ClassVar[str] = "github.dependabot_alert.reopened"
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
# =============================================================================
|
|
1899
|
+
# Label Event Payloads
|
|
1900
|
+
# =============================================================================
|
|
1901
|
+
|
|
1902
|
+
|
|
1903
|
+
class LabelBase(GitHubEventPayload):
|
|
1904
|
+
"""Base class for label.* events.
|
|
1905
|
+
|
|
1906
|
+
Triggered when a label is:
|
|
1907
|
+
- created
|
|
1908
|
+
- edited
|
|
1909
|
+
- deleted
|
|
1910
|
+
|
|
1911
|
+
Use action-specific classes like LabelCreated, etc.
|
|
1912
|
+
"""
|
|
1913
|
+
|
|
1914
|
+
action: str = Field(description="Event action: created, edited, or deleted")
|
|
1915
|
+
label: GitHubLabel = Field(description="The label that triggered the event")
|
|
1916
|
+
|
|
1917
|
+
|
|
1918
|
+
class LabelCreated(LabelBase):
|
|
1919
|
+
"""Payload for github.label.created events."""
|
|
1920
|
+
|
|
1921
|
+
_dispatch_topic: ClassVar[str] = "github.label.created"
|
|
1922
|
+
|
|
1923
|
+
|
|
1924
|
+
class LabelEdited(LabelBase):
|
|
1925
|
+
"""Payload for github.label.edited events."""
|
|
1926
|
+
|
|
1927
|
+
_dispatch_topic: ClassVar[str] = "github.label.edited"
|
|
1928
|
+
changes: GitHubChanges | None = Field(
|
|
1929
|
+
default=None, description="Changes made to the label"
|
|
1930
|
+
)
|
|
1931
|
+
|
|
1932
|
+
|
|
1933
|
+
class LabelDeleted(LabelBase):
|
|
1934
|
+
"""Payload for github.label.deleted events."""
|
|
1935
|
+
|
|
1936
|
+
_dispatch_topic: ClassVar[str] = "github.label.deleted"
|
|
1937
|
+
|
|
1938
|
+
|
|
1939
|
+
# =============================================================================
|
|
1940
|
+
# Release Event Payloads
|
|
1941
|
+
# =============================================================================
|
|
1942
|
+
|
|
1943
|
+
|
|
1944
|
+
class ReleaseBase(GitHubEventPayload):
|
|
1945
|
+
"""Base class for release.* events.
|
|
1946
|
+
|
|
1947
|
+
Triggered when a release is:
|
|
1948
|
+
- created (including draft releases)
|
|
1949
|
+
- published (draft -> public)
|
|
1950
|
+
- unpublished
|
|
1951
|
+
- edited
|
|
1952
|
+
- deleted
|
|
1953
|
+
- prereleased
|
|
1954
|
+
- released
|
|
1955
|
+
|
|
1956
|
+
Use action-specific classes like ReleasePublished, etc.
|
|
1957
|
+
"""
|
|
1958
|
+
|
|
1959
|
+
action: str = Field(
|
|
1960
|
+
description="Event action: created, published, edited, deleted, etc."
|
|
1961
|
+
)
|
|
1962
|
+
release: GitHubRelease = Field(description="Release data")
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
class ReleaseCreated(ReleaseBase):
|
|
1966
|
+
"""Payload for github.release.created events."""
|
|
1967
|
+
|
|
1968
|
+
_dispatch_topic: ClassVar[str] = "github.release.created"
|
|
1969
|
+
|
|
1970
|
+
|
|
1971
|
+
class ReleasePublished(ReleaseBase):
|
|
1972
|
+
"""Payload for github.release.published events."""
|
|
1973
|
+
|
|
1974
|
+
_dispatch_topic: ClassVar[str] = "github.release.published"
|
|
1975
|
+
|
|
1976
|
+
|
|
1977
|
+
class ReleaseUnpublished(ReleaseBase):
|
|
1978
|
+
"""Payload for github.release.unpublished events."""
|
|
1979
|
+
|
|
1980
|
+
_dispatch_topic: ClassVar[str] = "github.release.unpublished"
|
|
1981
|
+
|
|
1982
|
+
|
|
1983
|
+
class ReleaseEdited(ReleaseBase):
|
|
1984
|
+
"""Payload for github.release.edited events."""
|
|
1985
|
+
|
|
1986
|
+
_dispatch_topic: ClassVar[str] = "github.release.edited"
|
|
1987
|
+
changes: GitHubChanges = Field(description="Changes made to the release")
|
|
1988
|
+
|
|
1989
|
+
|
|
1990
|
+
class ReleaseDeleted(ReleaseBase):
|
|
1991
|
+
"""Payload for github.release.deleted events."""
|
|
1992
|
+
|
|
1993
|
+
_dispatch_topic: ClassVar[str] = "github.release.deleted"
|
|
1994
|
+
|
|
1995
|
+
|
|
1996
|
+
class ReleasePrereleased(ReleaseBase):
|
|
1997
|
+
"""Payload for github.release.prereleased events."""
|
|
1998
|
+
|
|
1999
|
+
_dispatch_topic: ClassVar[str] = "github.release.prereleased"
|
|
2000
|
+
|
|
2001
|
+
|
|
2002
|
+
class ReleaseReleased(ReleaseBase):
|
|
2003
|
+
"""Payload for github.release.released events."""
|
|
2004
|
+
|
|
2005
|
+
_dispatch_topic: ClassVar[str] = "github.release.released"
|
|
2006
|
+
|
|
2007
|
+
|
|
2008
|
+
# =============================================================================
|
|
2009
|
+
# Repository Event Payloads
|
|
2010
|
+
# =============================================================================
|
|
2011
|
+
|
|
2012
|
+
|
|
2013
|
+
class Create(GitHubEventPayload):
|
|
2014
|
+
"""Payload for github.create events.
|
|
2015
|
+
|
|
2016
|
+
Triggered when a branch or tag is created.
|
|
2017
|
+
This event has no action field.
|
|
2018
|
+
"""
|
|
2019
|
+
|
|
2020
|
+
_dispatch_topic: ClassVar[str] = "github.create"
|
|
2021
|
+
|
|
2022
|
+
ref: str = Field(description="Git ref name (branch or tag name)")
|
|
2023
|
+
ref_type: Literal["branch", "tag"] = Field(description="Type of ref: branch or tag")
|
|
2024
|
+
master_branch: str = Field(description="Default branch of the repository")
|
|
2025
|
+
description: str | None = Field(default=None, description="Repository description")
|
|
2026
|
+
pusher_type: str = Field(default="user", description="Pusher type")
|
|
2027
|
+
|
|
2028
|
+
|
|
2029
|
+
class Delete(GitHubEventPayload):
|
|
2030
|
+
"""Payload for github.delete events.
|
|
2031
|
+
|
|
2032
|
+
Triggered when a branch or tag is deleted.
|
|
2033
|
+
This event has no action field.
|
|
2034
|
+
"""
|
|
2035
|
+
|
|
2036
|
+
_dispatch_topic: ClassVar[str] = "github.delete"
|
|
2037
|
+
|
|
2038
|
+
ref: str = Field(description="Git ref name (branch or tag name)")
|
|
2039
|
+
ref_type: Literal["branch", "tag"] = Field(description="Type of ref: branch or tag")
|
|
2040
|
+
pusher_type: str = Field(default="user", description="Pusher type")
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
class Fork(GitHubEventPayload):
|
|
2044
|
+
"""Payload for github.fork events.
|
|
2045
|
+
|
|
2046
|
+
Triggered when a repository is forked.
|
|
2047
|
+
This event has no action field.
|
|
2048
|
+
"""
|
|
2049
|
+
|
|
2050
|
+
_dispatch_topic: ClassVar[str] = "github.fork"
|
|
2051
|
+
|
|
2052
|
+
forkee: GitHubRepository = Field(description="Newly created fork repository")
|
|
2053
|
+
|
|
2054
|
+
|
|
2055
|
+
class StarBase(GitHubEventPayload):
|
|
2056
|
+
"""Base class for star.* events.
|
|
2057
|
+
|
|
2058
|
+
Triggered when a repository is starred or unstarred.
|
|
2059
|
+
|
|
2060
|
+
Use action-specific classes like StarCreated, StarDeleted.
|
|
2061
|
+
"""
|
|
2062
|
+
|
|
2063
|
+
action: str = Field(description="Event action: created, deleted")
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
class StarCreated(StarBase):
|
|
2067
|
+
"""Payload for github.star.created events."""
|
|
2068
|
+
|
|
2069
|
+
_dispatch_topic: ClassVar[str] = "github.star.created"
|
|
2070
|
+
starred_at: str = Field(description="ISO8601 timestamp when starred")
|
|
2071
|
+
|
|
2072
|
+
|
|
2073
|
+
class StarDeleted(StarBase):
|
|
2074
|
+
"""Payload for github.star.deleted events."""
|
|
2075
|
+
|
|
2076
|
+
_dispatch_topic: ClassVar[str] = "github.star.deleted"
|
|
2077
|
+
starred_at: None = Field(default=None, description="Always null for deleted events")
|
|
2078
|
+
|
|
2079
|
+
|
|
2080
|
+
# =============================================================================
|
|
2081
|
+
# Installation Event Payloads (GitHub App specific)
|
|
2082
|
+
# =============================================================================
|
|
2083
|
+
|
|
2084
|
+
|
|
2085
|
+
class InstallationBase(BasePayload, GitHubModel):
|
|
2086
|
+
"""Base class for installation.* events.
|
|
2087
|
+
|
|
2088
|
+
Triggered when a GitHub App installation is:
|
|
2089
|
+
- created (App installed)
|
|
2090
|
+
- deleted (App uninstalled)
|
|
2091
|
+
- new_permissions_accepted
|
|
2092
|
+
- suspend
|
|
2093
|
+
- unsuspend
|
|
2094
|
+
|
|
2095
|
+
Note: Does not have repository field since it's about the App installation.
|
|
2096
|
+
|
|
2097
|
+
Use action-specific classes like InstallationCreated, etc.
|
|
2098
|
+
"""
|
|
2099
|
+
|
|
2100
|
+
_dispatch_topic: ClassVar[str] = ""
|
|
2101
|
+
|
|
2102
|
+
action: str = Field(
|
|
2103
|
+
description="Event action: created, deleted, suspend, unsuspend, etc."
|
|
2104
|
+
)
|
|
2105
|
+
installation: GitHubInstallation = Field(description="Installation data")
|
|
2106
|
+
sender: GitHubUser = Field(description="User who triggered the event")
|
|
2107
|
+
repositories: list[GitHubRepository] = Field(
|
|
2108
|
+
default_factory=list, description="Repositories with access"
|
|
2109
|
+
)
|
|
2110
|
+
|
|
2111
|
+
@classmethod
|
|
2112
|
+
def dispatch_topic(cls) -> str:
|
|
2113
|
+
"""Return the topic string for this event type."""
|
|
2114
|
+
if not cls._dispatch_topic:
|
|
2115
|
+
raise NotImplementedError(
|
|
2116
|
+
f"{cls.__name__} must define _dispatch_topic to use dispatch_topic()"
|
|
2117
|
+
)
|
|
2118
|
+
return cls._dispatch_topic
|
|
2119
|
+
|
|
2120
|
+
|
|
2121
|
+
class InstallationCreated(InstallationBase):
|
|
2122
|
+
"""Payload for github.installation.created events."""
|
|
2123
|
+
|
|
2124
|
+
_dispatch_topic: ClassVar[str] = "github.installation.created"
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
class InstallationDeleted(InstallationBase):
|
|
2128
|
+
"""Payload for github.installation.deleted events."""
|
|
2129
|
+
|
|
2130
|
+
_dispatch_topic: ClassVar[str] = "github.installation.deleted"
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
class InstallationSuspend(InstallationBase):
|
|
2134
|
+
"""Payload for github.installation.suspend events."""
|
|
2135
|
+
|
|
2136
|
+
_dispatch_topic: ClassVar[str] = "github.installation.suspend"
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
class InstallationUnsuspend(InstallationBase):
|
|
2140
|
+
"""Payload for github.installation.unsuspend events."""
|
|
2141
|
+
|
|
2142
|
+
_dispatch_topic: ClassVar[str] = "github.installation.unsuspend"
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
class InstallationNewPermissionsAccepted(InstallationBase):
|
|
2146
|
+
"""Payload for github.installation.new_permissions_accepted events."""
|
|
2147
|
+
|
|
2148
|
+
_dispatch_topic: ClassVar[str] = "github.installation.new_permissions_accepted"
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
class InstallationRepositoriesBase(BasePayload, GitHubModel):
|
|
2152
|
+
"""Base class for installation_repositories.* events.
|
|
2153
|
+
|
|
2154
|
+
Triggered when repositories are added or removed from an installation.
|
|
2155
|
+
|
|
2156
|
+
Use action-specific classes like InstallationRepositoriesAdded, etc.
|
|
2157
|
+
"""
|
|
2158
|
+
|
|
2159
|
+
_dispatch_topic: ClassVar[str] = ""
|
|
2160
|
+
|
|
2161
|
+
action: str = Field(description="Event action: added, removed")
|
|
2162
|
+
installation: GitHubInstallation = Field(description="Installation data")
|
|
2163
|
+
sender: GitHubUser = Field(description="User who triggered the event")
|
|
2164
|
+
requester: GitHubUser | None = Field(
|
|
2165
|
+
default=None, description="User who requested the change (may be null)"
|
|
2166
|
+
)
|
|
2167
|
+
repositories_added: list[GitHubRepository] = Field(
|
|
2168
|
+
default_factory=list, description="Repositories added"
|
|
2169
|
+
)
|
|
2170
|
+
repositories_removed: list[GitHubRepository] = Field(
|
|
2171
|
+
default_factory=list, description="Repositories removed"
|
|
2172
|
+
)
|
|
2173
|
+
repository_selection: str = Field(
|
|
2174
|
+
default="all", description="Repository selection: all or selected"
|
|
2175
|
+
)
|
|
2176
|
+
|
|
2177
|
+
@classmethod
|
|
2178
|
+
def dispatch_topic(cls) -> str:
|
|
2179
|
+
"""Return the topic string for this event type."""
|
|
2180
|
+
if not cls._dispatch_topic:
|
|
2181
|
+
raise NotImplementedError(
|
|
2182
|
+
f"{cls.__name__} must define _dispatch_topic to use dispatch_topic()"
|
|
2183
|
+
)
|
|
2184
|
+
return cls._dispatch_topic
|
|
2185
|
+
|
|
2186
|
+
|
|
2187
|
+
class InstallationRepositoriesAdded(InstallationRepositoriesBase):
|
|
2188
|
+
"""Payload for github.installation_repositories.added events."""
|
|
2189
|
+
|
|
2190
|
+
_dispatch_topic: ClassVar[str] = "github.installation_repositories.added"
|
|
2191
|
+
|
|
2192
|
+
|
|
2193
|
+
class InstallationRepositoriesRemoved(InstallationRepositoriesBase):
|
|
2194
|
+
"""Payload for github.installation_repositories.removed events."""
|
|
2195
|
+
|
|
2196
|
+
_dispatch_topic: ClassVar[str] = "github.installation_repositories.removed"
|
|
2197
|
+
|
|
2198
|
+
|
|
2199
|
+
# =============================================================================
|
|
2200
|
+
# Watch Event Payloads
|
|
2201
|
+
# =============================================================================
|
|
2202
|
+
|
|
2203
|
+
|
|
2204
|
+
class WatchBase(GitHubEventPayload):
|
|
2205
|
+
"""Base class for watch.* events.
|
|
2206
|
+
|
|
2207
|
+
Triggered when a repository is starred (watch).
|
|
2208
|
+
GitHub only fires watch.started — watch.deleted is not sent.
|
|
2209
|
+
"""
|
|
2210
|
+
|
|
2211
|
+
action: str = Field(description="Event action: started")
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
class WatchStarted(WatchBase):
|
|
2215
|
+
"""Payload for github.watch.started events."""
|
|
2216
|
+
|
|
2217
|
+
_dispatch_topic: ClassVar[str] = "github.watch.started"
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
# =============================================================================
|
|
2221
|
+
# Public Event Payload (no action)
|
|
2222
|
+
# =============================================================================
|
|
2223
|
+
|
|
2224
|
+
|
|
2225
|
+
class Public(GitHubEventPayload):
|
|
2226
|
+
"""Payload for github.public events.
|
|
2227
|
+
|
|
2228
|
+
Triggered when a private repository is made public.
|
|
2229
|
+
This event has no action field.
|
|
2230
|
+
"""
|
|
2231
|
+
|
|
2232
|
+
_dispatch_topic: ClassVar[str] = "github.public"
|
|
2233
|
+
|
|
2234
|
+
|
|
2235
|
+
# =============================================================================
|
|
2236
|
+
# Gollum Event Payload (Wiki, no action)
|
|
2237
|
+
# =============================================================================
|
|
2238
|
+
|
|
2239
|
+
|
|
2240
|
+
class Gollum(GitHubEventPayload):
|
|
2241
|
+
"""Payload for github.gollum events (wiki page changes).
|
|
2242
|
+
|
|
2243
|
+
Triggered when a wiki page is created or updated.
|
|
2244
|
+
This event has no action field.
|
|
2245
|
+
"""
|
|
2246
|
+
|
|
2247
|
+
_dispatch_topic: ClassVar[str] = "github.gollum"
|
|
2248
|
+
|
|
2249
|
+
pages: list[dict[str, Any]] = Field(
|
|
2250
|
+
description="Wiki pages that were created or updated"
|
|
2251
|
+
)
|
|
2252
|
+
|
|
2253
|
+
|
|
2254
|
+
# =============================================================================
|
|
2255
|
+
# Ping Event Payload (no action)
|
|
2256
|
+
# =============================================================================
|
|
2257
|
+
|
|
2258
|
+
|
|
2259
|
+
class Ping(GitHubEventPayload):
|
|
2260
|
+
"""Payload for github.ping events.
|
|
2261
|
+
|
|
2262
|
+
Sent by GitHub when a webhook is first created or re-delivered manually.
|
|
2263
|
+
This event has no action field.
|
|
2264
|
+
"""
|
|
2265
|
+
|
|
2266
|
+
_dispatch_topic: ClassVar[str] = "github.ping"
|
|
2267
|
+
|
|
2268
|
+
zen: str = Field(description="A random zen message from GitHub")
|
|
2269
|
+
hook_id: int = Field(description="ID of the webhook that triggered the ping")
|
|
2270
|
+
hook: dict[str, Any] = Field(description="Webhook configuration object")
|
|
2271
|
+
|
|
2272
|
+
|
|
2273
|
+
# =============================================================================
|
|
2274
|
+
# Repository Import Event Payload (no action)
|
|
2275
|
+
# =============================================================================
|
|
2276
|
+
|
|
2277
|
+
|
|
2278
|
+
class RepositoryImport(GitHubEventPayload):
|
|
2279
|
+
"""Payload for github.repository_import events.
|
|
2280
|
+
|
|
2281
|
+
Triggered when a repository import is started, cancelled, or completed.
|
|
2282
|
+
This event has no action field — the status field indicates state.
|
|
2283
|
+
"""
|
|
2284
|
+
|
|
2285
|
+
_dispatch_topic: ClassVar[str] = "github.repository_import"
|
|
2286
|
+
|
|
2287
|
+
status: str = Field(description="Import status: success, cancelled, or failure")
|
|
2288
|
+
|
|
2289
|
+
|
|
2290
|
+
# =============================================================================
|
|
2291
|
+
# Page Build Event Payload (no action)
|
|
2292
|
+
# =============================================================================
|
|
2293
|
+
|
|
2294
|
+
|
|
2295
|
+
class PageBuild(GitHubEventPayload):
|
|
2296
|
+
"""Payload for github.page_build events.
|
|
2297
|
+
|
|
2298
|
+
Triggered on every push to a GitHub Pages enabled branch.
|
|
2299
|
+
This event has no action field.
|
|
2300
|
+
"""
|
|
2301
|
+
|
|
2302
|
+
_dispatch_topic: ClassVar[str] = "github.page_build"
|
|
2303
|
+
|
|
2304
|
+
id: int = Field(description="Unique identifier of the page build")
|
|
2305
|
+
build: dict[str, Any] = Field(description="Page build details")
|
|
2306
|
+
|
|
2307
|
+
|
|
2308
|
+
# =============================================================================
|
|
2309
|
+
# GitHub App Authorization Event Payload
|
|
2310
|
+
# =============================================================================
|
|
2311
|
+
|
|
2312
|
+
|
|
2313
|
+
class GitHubAppAuthorizationBase(GitHubEventPayload):
|
|
2314
|
+
"""Base class for github_app_authorization.* events.
|
|
2315
|
+
|
|
2316
|
+
Triggered when a user revokes authorization of a GitHub App.
|
|
2317
|
+
"""
|
|
2318
|
+
|
|
2319
|
+
action: str = Field(description="Event action: revoked")
|
|
2320
|
+
|
|
2321
|
+
|
|
2322
|
+
class GitHubAppAuthorizationRevoked(GitHubAppAuthorizationBase):
|
|
2323
|
+
"""Payload for github.github_app_authorization.revoked events."""
|
|
2324
|
+
|
|
2325
|
+
_dispatch_topic: ClassVar[str] = "github.github_app_authorization.revoked"
|
|
2326
|
+
|
|
2327
|
+
|
|
2328
|
+
# =============================================================================
|
|
2329
|
+
# Team Add Event Payload (no action)
|
|
2330
|
+
# =============================================================================
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
class TeamAdd(GitHubEventPayload):
|
|
2334
|
+
"""Payload for github.team_add events.
|
|
2335
|
+
|
|
2336
|
+
Triggered when a repository is added to a team.
|
|
2337
|
+
This event has no action field.
|
|
2338
|
+
"""
|
|
2339
|
+
|
|
2340
|
+
_dispatch_topic: ClassVar[str] = "github.team_add"
|
|
2341
|
+
|
|
2342
|
+
team: dict[str, Any] = Field(description="Team that was given access")
|
|
2343
|
+
|
|
2344
|
+
|
|
2345
|
+
# =============================================================================
|
|
2346
|
+
# Branch Protection Configuration Event Payloads
|
|
2347
|
+
# =============================================================================
|
|
2348
|
+
|
|
2349
|
+
|
|
2350
|
+
class BranchProtectionConfigurationBase(GitHubEventPayload):
|
|
2351
|
+
"""Base class for branch_protection_configuration.* events.
|
|
2352
|
+
|
|
2353
|
+
Triggered when branch protection is enabled or disabled for a repository.
|
|
2354
|
+
"""
|
|
2355
|
+
|
|
2356
|
+
action: str = Field(description="Event action: enabled or disabled")
|
|
2357
|
+
|
|
2358
|
+
|
|
2359
|
+
class BranchProtectionConfigurationEnabled(BranchProtectionConfigurationBase):
|
|
2360
|
+
"""Payload for github.branch_protection_configuration.enabled events."""
|
|
2361
|
+
|
|
2362
|
+
_dispatch_topic: ClassVar[str] = "github.branch_protection_configuration.enabled"
|
|
2363
|
+
|
|
2364
|
+
|
|
2365
|
+
class BranchProtectionConfigurationDisabled(BranchProtectionConfigurationBase):
|
|
2366
|
+
"""Payload for github.branch_protection_configuration.disabled events."""
|
|
2367
|
+
|
|
2368
|
+
_dispatch_topic: ClassVar[str] = "github.branch_protection_configuration.disabled"
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
# =============================================================================
|
|
2372
|
+
# Branch Protection Rule Event Payloads
|
|
2373
|
+
# =============================================================================
|
|
2374
|
+
|
|
2375
|
+
|
|
2376
|
+
class BranchProtectionRuleBase(GitHubEventPayload):
|
|
2377
|
+
"""Base class for branch_protection_rule.* events.
|
|
2378
|
+
|
|
2379
|
+
Triggered when a branch protection rule is created, deleted, or edited.
|
|
2380
|
+
"""
|
|
2381
|
+
|
|
2382
|
+
action: str = Field(description="Event action: created, deleted, or edited")
|
|
2383
|
+
rule: dict[str, Any] = Field(description="Branch protection rule data")
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
class BranchProtectionRuleCreated(BranchProtectionRuleBase):
|
|
2387
|
+
"""Payload for github.branch_protection_rule.created events."""
|
|
2388
|
+
|
|
2389
|
+
_dispatch_topic: ClassVar[str] = "github.branch_protection_rule.created"
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
class BranchProtectionRuleDeleted(BranchProtectionRuleBase):
|
|
2393
|
+
"""Payload for github.branch_protection_rule.deleted events."""
|
|
2394
|
+
|
|
2395
|
+
_dispatch_topic: ClassVar[str] = "github.branch_protection_rule.deleted"
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
class BranchProtectionRuleEdited(BranchProtectionRuleBase):
|
|
2399
|
+
"""Payload for github.branch_protection_rule.edited events."""
|
|
2400
|
+
|
|
2401
|
+
_dispatch_topic: ClassVar[str] = "github.branch_protection_rule.edited"
|
|
2402
|
+
changes: GitHubChanges | None = Field(
|
|
2403
|
+
default=None, description="Changes made to the rule"
|
|
2404
|
+
)
|
|
2405
|
+
|
|
2406
|
+
|
|
2407
|
+
# =============================================================================
|
|
2408
|
+
# Commit Comment Event Payloads
|
|
2409
|
+
# =============================================================================
|
|
2410
|
+
|
|
2411
|
+
|
|
2412
|
+
class CommitCommentBase(GitHubEventPayload):
|
|
2413
|
+
"""Base class for commit_comment.* events.
|
|
2414
|
+
|
|
2415
|
+
Triggered when a comment is created on a commit.
|
|
2416
|
+
"""
|
|
2417
|
+
|
|
2418
|
+
action: str = Field(description="Event action: created")
|
|
2419
|
+
comment: dict[str, Any] = Field(description="Comment on the commit")
|
|
2420
|
+
|
|
2421
|
+
|
|
2422
|
+
class CommitCommentCreated(CommitCommentBase):
|
|
2423
|
+
"""Payload for github.commit_comment.created events."""
|
|
2424
|
+
|
|
2425
|
+
_dispatch_topic: ClassVar[str] = "github.commit_comment.created"
|
|
2426
|
+
|
|
2427
|
+
|
|
2428
|
+
# =============================================================================
|
|
2429
|
+
# Deploy Key Event Payloads
|
|
2430
|
+
# =============================================================================
|
|
2431
|
+
|
|
2432
|
+
|
|
2433
|
+
class DeployKeyBase(GitHubEventPayload):
|
|
2434
|
+
"""Base class for deploy_key.* events.
|
|
2435
|
+
|
|
2436
|
+
Triggered when a deploy key is created or deleted.
|
|
2437
|
+
"""
|
|
2438
|
+
|
|
2439
|
+
action: str = Field(description="Event action: created or deleted")
|
|
2440
|
+
key: dict[str, Any] = Field(description="Deploy key data")
|
|
2441
|
+
|
|
2442
|
+
|
|
2443
|
+
class DeployKeyCreated(DeployKeyBase):
|
|
2444
|
+
"""Payload for github.deploy_key.created events."""
|
|
2445
|
+
|
|
2446
|
+
_dispatch_topic: ClassVar[str] = "github.deploy_key.created"
|
|
2447
|
+
|
|
2448
|
+
|
|
2449
|
+
class DeployKeyDeleted(DeployKeyBase):
|
|
2450
|
+
"""Payload for github.deploy_key.deleted events."""
|
|
2451
|
+
|
|
2452
|
+
_dispatch_topic: ClassVar[str] = "github.deploy_key.deleted"
|
|
2453
|
+
|
|
2454
|
+
|
|
2455
|
+
# =============================================================================
|
|
2456
|
+
# Member Event Payloads
|
|
2457
|
+
# =============================================================================
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
class MemberBase(GitHubEventPayload):
|
|
2461
|
+
"""Base class for member.* events.
|
|
2462
|
+
|
|
2463
|
+
Triggered when a collaborator is added, removed, or when their
|
|
2464
|
+
permissions are changed on a repository.
|
|
2465
|
+
"""
|
|
2466
|
+
|
|
2467
|
+
action: str = Field(description="Event action: added, removed, or edited")
|
|
2468
|
+
member: GitHubUser = Field(description="User whose membership changed")
|
|
2469
|
+
|
|
2470
|
+
|
|
2471
|
+
class MemberAdded(MemberBase):
|
|
2472
|
+
"""Payload for github.member.added events."""
|
|
2473
|
+
|
|
2474
|
+
_dispatch_topic: ClassVar[str] = "github.member.added"
|
|
2475
|
+
changes: GitHubChanges | None = Field(
|
|
2476
|
+
default=None, description="Changes to the member's permissions"
|
|
2477
|
+
)
|
|
2478
|
+
|
|
2479
|
+
|
|
2480
|
+
class MemberEdited(MemberBase):
|
|
2481
|
+
"""Payload for github.member.edited events."""
|
|
2482
|
+
|
|
2483
|
+
_dispatch_topic: ClassVar[str] = "github.member.edited"
|
|
2484
|
+
changes: GitHubChanges = Field(description="Changes to the member's permissions")
|
|
2485
|
+
|
|
2486
|
+
|
|
2487
|
+
class MemberRemoved(MemberBase):
|
|
2488
|
+
"""Payload for github.member.removed events."""
|
|
2489
|
+
|
|
2490
|
+
_dispatch_topic: ClassVar[str] = "github.member.removed"
|
|
2491
|
+
|
|
2492
|
+
|
|
2493
|
+
# =============================================================================
|
|
2494
|
+
# Membership Event Payloads
|
|
2495
|
+
# =============================================================================
|
|
2496
|
+
|
|
2497
|
+
|
|
2498
|
+
class MembershipBase(GitHubEventPayload):
|
|
2499
|
+
"""Base class for membership.* events.
|
|
2500
|
+
|
|
2501
|
+
Triggered when a user is added or removed from a team.
|
|
2502
|
+
"""
|
|
2503
|
+
|
|
2504
|
+
action: str = Field(description="Event action: added or removed")
|
|
2505
|
+
scope: str = Field(description="Scope of the membership: team")
|
|
2506
|
+
member: GitHubUser = Field(description="User whose team membership changed")
|
|
2507
|
+
team: dict[str, Any] = Field(
|
|
2508
|
+
description="Team the user was added to or removed from"
|
|
2509
|
+
)
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
class MembershipAdded(MembershipBase):
|
|
2513
|
+
"""Payload for github.membership.added events."""
|
|
2514
|
+
|
|
2515
|
+
_dispatch_topic: ClassVar[str] = "github.membership.added"
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
class MembershipRemoved(MembershipBase):
|
|
2519
|
+
"""Payload for github.membership.removed events."""
|
|
2520
|
+
|
|
2521
|
+
_dispatch_topic: ClassVar[str] = "github.membership.removed"
|
|
2522
|
+
|
|
2523
|
+
|
|
2524
|
+
# =============================================================================
|
|
2525
|
+
# Merge Group Event Payloads
|
|
2526
|
+
# =============================================================================
|
|
2527
|
+
|
|
2528
|
+
|
|
2529
|
+
class MergeGroupBase(GitHubEventPayload):
|
|
2530
|
+
"""Base class for merge_group.* events.
|
|
2531
|
+
|
|
2532
|
+
Triggered when a merge group is created or destroyed, or when its
|
|
2533
|
+
checks are requested.
|
|
2534
|
+
"""
|
|
2535
|
+
|
|
2536
|
+
action: str = Field(description="Event action: checks_requested or destroyed")
|
|
2537
|
+
merge_group: dict[str, Any] = Field(description="Merge group data")
|
|
2538
|
+
|
|
2539
|
+
|
|
2540
|
+
class MergeGroupChecksRequested(MergeGroupBase):
|
|
2541
|
+
"""Payload for github.merge_group.checks_requested events."""
|
|
2542
|
+
|
|
2543
|
+
_dispatch_topic: ClassVar[str] = "github.merge_group.checks_requested"
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
class MergeGroupDestroyed(MergeGroupBase):
|
|
2547
|
+
"""Payload for github.merge_group.destroyed events."""
|
|
2548
|
+
|
|
2549
|
+
_dispatch_topic: ClassVar[str] = "github.merge_group.destroyed"
|
|
2550
|
+
reason: str = Field(
|
|
2551
|
+
description="Reason the merge group was destroyed: merged, invalidated, or dequeued"
|
|
2552
|
+
)
|
|
2553
|
+
|
|
2554
|
+
|
|
2555
|
+
# =============================================================================
|
|
2556
|
+
# Meta Event Payloads (webhook deletion)
|
|
2557
|
+
# =============================================================================
|
|
2558
|
+
|
|
2559
|
+
|
|
2560
|
+
class MetaBase(GitHubEventPayload):
|
|
2561
|
+
"""Base class for meta.* events.
|
|
2562
|
+
|
|
2563
|
+
Triggered when a webhook is deleted.
|
|
2564
|
+
"""
|
|
2565
|
+
|
|
2566
|
+
action: str = Field(description="Event action: deleted")
|
|
2567
|
+
hook_id: int = Field(description="ID of the modified webhook")
|
|
2568
|
+
hook: dict[str, Any] = Field(description="Modified webhook data")
|
|
2569
|
+
|
|
2570
|
+
|
|
2571
|
+
class MetaDeleted(MetaBase):
|
|
2572
|
+
"""Payload for github.meta.deleted events."""
|
|
2573
|
+
|
|
2574
|
+
_dispatch_topic: ClassVar[str] = "github.meta.deleted"
|
|
2575
|
+
|
|
2576
|
+
|
|
2577
|
+
# =============================================================================
|
|
2578
|
+
# Milestone Event Payloads
|
|
2579
|
+
# =============================================================================
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
class MilestoneEventBase(GitHubEventPayload):
|
|
2583
|
+
"""Base class for milestone.* events.
|
|
2584
|
+
|
|
2585
|
+
Triggered when a milestone is created, closed, deleted, edited, or opened.
|
|
2586
|
+
Note: This is for milestone events, not the GitHubMilestone model used in
|
|
2587
|
+
issue/PR payloads.
|
|
2588
|
+
"""
|
|
2589
|
+
|
|
2590
|
+
action: str = Field(
|
|
2591
|
+
description="Event action: created, closed, deleted, edited, or opened"
|
|
2592
|
+
)
|
|
2593
|
+
milestone: GitHubMilestone = Field(description="Milestone that triggered the event")
|
|
2594
|
+
|
|
2595
|
+
|
|
2596
|
+
class MilestoneClosed(MilestoneEventBase):
|
|
2597
|
+
"""Payload for github.milestone.closed events."""
|
|
2598
|
+
|
|
2599
|
+
_dispatch_topic: ClassVar[str] = "github.milestone.closed"
|
|
2600
|
+
|
|
2601
|
+
|
|
2602
|
+
class MilestoneCreated(MilestoneEventBase):
|
|
2603
|
+
"""Payload for github.milestone.created events."""
|
|
2604
|
+
|
|
2605
|
+
_dispatch_topic: ClassVar[str] = "github.milestone.created"
|
|
2606
|
+
|
|
2607
|
+
|
|
2608
|
+
class MilestoneDeleted(MilestoneEventBase):
|
|
2609
|
+
"""Payload for github.milestone.deleted events."""
|
|
2610
|
+
|
|
2611
|
+
_dispatch_topic: ClassVar[str] = "github.milestone.deleted"
|
|
2612
|
+
|
|
2613
|
+
|
|
2614
|
+
class MilestoneEdited(MilestoneEventBase):
|
|
2615
|
+
"""Payload for github.milestone.edited events."""
|
|
2616
|
+
|
|
2617
|
+
_dispatch_topic: ClassVar[str] = "github.milestone.edited"
|
|
2618
|
+
changes: GitHubChanges = Field(description="Changes made to the milestone")
|
|
2619
|
+
|
|
2620
|
+
|
|
2621
|
+
class MilestoneOpened(MilestoneEventBase):
|
|
2622
|
+
"""Payload for github.milestone.opened events."""
|
|
2623
|
+
|
|
2624
|
+
_dispatch_topic: ClassVar[str] = "github.milestone.opened"
|
|
2625
|
+
|
|
2626
|
+
|
|
2627
|
+
# =============================================================================
|
|
2628
|
+
# Org Block Event Payloads
|
|
2629
|
+
# =============================================================================
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
class OrgBlockBase(GitHubEventPayload):
|
|
2633
|
+
"""Base class for org_block.* events.
|
|
2634
|
+
|
|
2635
|
+
Triggered when an organization blocks or unblocks a user.
|
|
2636
|
+
"""
|
|
2637
|
+
|
|
2638
|
+
action: str = Field(description="Event action: blocked or unblocked")
|
|
2639
|
+
blocked_user: GitHubUser = Field(description="User who was blocked or unblocked")
|
|
2640
|
+
|
|
2641
|
+
|
|
2642
|
+
class OrgBlockBlocked(OrgBlockBase):
|
|
2643
|
+
"""Payload for github.org_block.blocked events."""
|
|
2644
|
+
|
|
2645
|
+
_dispatch_topic: ClassVar[str] = "github.org_block.blocked"
|
|
2646
|
+
|
|
2647
|
+
|
|
2648
|
+
class OrgBlockUnblocked(OrgBlockBase):
|
|
2649
|
+
"""Payload for github.org_block.unblocked events."""
|
|
2650
|
+
|
|
2651
|
+
_dispatch_topic: ClassVar[str] = "github.org_block.unblocked"
|
|
2652
|
+
|
|
2653
|
+
|
|
2654
|
+
# =============================================================================
|
|
2655
|
+
# Repository Event Payloads
|
|
2656
|
+
# =============================================================================
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
class RepositoryEventBase(GitHubEventPayload):
|
|
2660
|
+
"""Base class for repository.* events.
|
|
2661
|
+
|
|
2662
|
+
Triggered when a repository is created, deleted, archived, unarchived,
|
|
2663
|
+
publicized, privatized, edited, renamed, or transferred.
|
|
2664
|
+
"""
|
|
2665
|
+
|
|
2666
|
+
action: str = Field(
|
|
2667
|
+
description="Event action: archived, created, deleted, edited, "
|
|
2668
|
+
"privatized, publicized, renamed, transferred, or unarchived"
|
|
2669
|
+
)
|
|
2670
|
+
|
|
2671
|
+
|
|
2672
|
+
class RepositoryArchived(RepositoryEventBase):
|
|
2673
|
+
"""Payload for github.repository.archived events."""
|
|
2674
|
+
|
|
2675
|
+
_dispatch_topic: ClassVar[str] = "github.repository.archived"
|
|
2676
|
+
|
|
2677
|
+
|
|
2678
|
+
class RepositoryCreated(RepositoryEventBase):
|
|
2679
|
+
"""Payload for github.repository.created events."""
|
|
2680
|
+
|
|
2681
|
+
_dispatch_topic: ClassVar[str] = "github.repository.created"
|
|
2682
|
+
|
|
2683
|
+
|
|
2684
|
+
class RepositoryDeleted(RepositoryEventBase):
|
|
2685
|
+
"""Payload for github.repository.deleted events."""
|
|
2686
|
+
|
|
2687
|
+
_dispatch_topic: ClassVar[str] = "github.repository.deleted"
|
|
2688
|
+
|
|
2689
|
+
|
|
2690
|
+
class RepositoryEdited(RepositoryEventBase):
|
|
2691
|
+
"""Payload for github.repository.edited events."""
|
|
2692
|
+
|
|
2693
|
+
_dispatch_topic: ClassVar[str] = "github.repository.edited"
|
|
2694
|
+
changes: GitHubChanges = Field(description="Changes made to the repository")
|
|
2695
|
+
|
|
2696
|
+
|
|
2697
|
+
class RepositoryPrivatized(RepositoryEventBase):
|
|
2698
|
+
"""Payload for github.repository.privatized events."""
|
|
2699
|
+
|
|
2700
|
+
_dispatch_topic: ClassVar[str] = "github.repository.privatized"
|
|
2701
|
+
|
|
2702
|
+
|
|
2703
|
+
class RepositoryPublicized(RepositoryEventBase):
|
|
2704
|
+
"""Payload for github.repository.publicized events."""
|
|
2705
|
+
|
|
2706
|
+
_dispatch_topic: ClassVar[str] = "github.repository.publicized"
|
|
2707
|
+
|
|
2708
|
+
|
|
2709
|
+
class RepositoryRenamed(RepositoryEventBase):
|
|
2710
|
+
"""Payload for github.repository.renamed events."""
|
|
2711
|
+
|
|
2712
|
+
_dispatch_topic: ClassVar[str] = "github.repository.renamed"
|
|
2713
|
+
changes: GitHubChanges = Field(description="Changes made to the repository name")
|
|
2714
|
+
|
|
2715
|
+
|
|
2716
|
+
class RepositoryTransferred(RepositoryEventBase):
|
|
2717
|
+
"""Payload for github.repository.transferred events."""
|
|
2718
|
+
|
|
2719
|
+
_dispatch_topic: ClassVar[str] = "github.repository.transferred"
|
|
2720
|
+
changes: GitHubChanges = Field(description="Changes from the transfer")
|
|
2721
|
+
|
|
2722
|
+
|
|
2723
|
+
class RepositoryUnarchived(RepositoryEventBase):
|
|
2724
|
+
"""Payload for github.repository.unarchived events."""
|
|
2725
|
+
|
|
2726
|
+
_dispatch_topic: ClassVar[str] = "github.repository.unarchived"
|
|
2727
|
+
|
|
2728
|
+
|
|
2729
|
+
# =============================================================================
|
|
2730
|
+
# Repository Dispatch Event Payload
|
|
2731
|
+
# =============================================================================
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
class RepositoryDispatch(GitHubEventPayload):
|
|
2735
|
+
"""Payload for github.repository_dispatch events.
|
|
2736
|
+
|
|
2737
|
+
Triggered when a client sends a POST request to the repository dispatch
|
|
2738
|
+
endpoint. The action is user-defined.
|
|
2739
|
+
"""
|
|
2740
|
+
|
|
2741
|
+
_dispatch_topic: ClassVar[str] = "github.repository_dispatch"
|
|
2742
|
+
|
|
2743
|
+
action: str = Field(description="User-defined event action")
|
|
2744
|
+
branch: str = Field(description="Branch the dispatch was triggered on")
|
|
2745
|
+
client_payload: dict[str, Any] = Field(
|
|
2746
|
+
description="User-defined payload sent with the dispatch"
|
|
2747
|
+
)
|
|
2748
|
+
installation: GitHubInstallation = Field(
|
|
2749
|
+
description="GitHub App installation that triggered the dispatch"
|
|
2750
|
+
)
|
|
2751
|
+
|
|
2752
|
+
|
|
2753
|
+
# =============================================================================
|
|
2754
|
+
# Discussion Event Payloads
|
|
2755
|
+
# =============================================================================
|
|
2756
|
+
|
|
2757
|
+
|
|
2758
|
+
class GitHubDiscussion(GitHubModel):
|
|
2759
|
+
"""GitHub Discussions post."""
|
|
2760
|
+
|
|
2761
|
+
id: int = Field(description="Unique numeric ID")
|
|
2762
|
+
node_id: str = Field(description="GraphQL node ID")
|
|
2763
|
+
number: int = Field(description="Discussion number in the repository")
|
|
2764
|
+
title: str = Field(description="Discussion title")
|
|
2765
|
+
body: str | None = Field(default=None, description="Discussion body text")
|
|
2766
|
+
state: str = Field(description="State: open or closed")
|
|
2767
|
+
category: dict[str, Any] = Field(description="Discussion category")
|
|
2768
|
+
author_association: str = Field(
|
|
2769
|
+
description="Author's association with the repository"
|
|
2770
|
+
)
|
|
2771
|
+
html_url: str = Field(description="Web URL for the discussion")
|
|
2772
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
2773
|
+
updated_at: str = Field(description="ISO8601 last updated timestamp")
|
|
2774
|
+
answered_at: str | None = Field(
|
|
2775
|
+
default=None, description="ISO8601 timestamp when marked as answered"
|
|
2776
|
+
)
|
|
2777
|
+
answer_html_url: str | None = Field(
|
|
2778
|
+
default=None, description="URL of the answer comment"
|
|
2779
|
+
)
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
class DiscussionBase(GitHubEventPayload):
|
|
2783
|
+
"""Base class for discussion.* events."""
|
|
2784
|
+
|
|
2785
|
+
action: str = Field(
|
|
2786
|
+
description="Event action: answered, category_changed, created, deleted, "
|
|
2787
|
+
"edited, labeled, locked, pinned, transferred, unanswered, "
|
|
2788
|
+
"unlabeled, unlocked, or unpinned"
|
|
2789
|
+
)
|
|
2790
|
+
discussion: GitHubDiscussion = Field(
|
|
2791
|
+
description="Discussion that triggered the event"
|
|
2792
|
+
)
|
|
2793
|
+
|
|
2794
|
+
|
|
2795
|
+
class DiscussionAnswered(DiscussionBase):
|
|
2796
|
+
"""Payload for github.discussion.answered events."""
|
|
2797
|
+
|
|
2798
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.answered"
|
|
2799
|
+
answer: dict[str, Any] = Field(description="Comment that was marked as the answer")
|
|
2800
|
+
|
|
2801
|
+
|
|
2802
|
+
class DiscussionCategoryChanged(DiscussionBase):
|
|
2803
|
+
"""Payload for github.discussion.category_changed events."""
|
|
2804
|
+
|
|
2805
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.category_changed"
|
|
2806
|
+
changes: GitHubChanges = Field(description="Changes to the discussion category")
|
|
2807
|
+
|
|
2808
|
+
|
|
2809
|
+
class DiscussionCreated(DiscussionBase):
|
|
2810
|
+
"""Payload for github.discussion.created events."""
|
|
2811
|
+
|
|
2812
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.created"
|
|
2813
|
+
|
|
2814
|
+
|
|
2815
|
+
class DiscussionDeleted(DiscussionBase):
|
|
2816
|
+
"""Payload for github.discussion.deleted events."""
|
|
2817
|
+
|
|
2818
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.deleted"
|
|
2819
|
+
|
|
2820
|
+
|
|
2821
|
+
class DiscussionEdited(DiscussionBase):
|
|
2822
|
+
"""Payload for github.discussion.edited events."""
|
|
2823
|
+
|
|
2824
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.edited"
|
|
2825
|
+
changes: GitHubChanges | None = Field(
|
|
2826
|
+
default=None, description="Changes made to the discussion"
|
|
2827
|
+
)
|
|
2828
|
+
|
|
2829
|
+
|
|
2830
|
+
class DiscussionLabeled(DiscussionBase):
|
|
2831
|
+
"""Payload for github.discussion.labeled events."""
|
|
2832
|
+
|
|
2833
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.labeled"
|
|
2834
|
+
label: GitHubLabel = Field(description="Label added to the discussion")
|
|
2835
|
+
|
|
2836
|
+
|
|
2837
|
+
class DiscussionLocked(DiscussionBase):
|
|
2838
|
+
"""Payload for github.discussion.locked events."""
|
|
2839
|
+
|
|
2840
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.locked"
|
|
2841
|
+
|
|
2842
|
+
|
|
2843
|
+
class DiscussionPinned(DiscussionBase):
|
|
2844
|
+
"""Payload for github.discussion.pinned events."""
|
|
2845
|
+
|
|
2846
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.pinned"
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
class DiscussionTransferred(DiscussionBase):
|
|
2850
|
+
"""Payload for github.discussion.transferred events."""
|
|
2851
|
+
|
|
2852
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.transferred"
|
|
2853
|
+
changes: GitHubChanges = Field(description="Changes from the transfer")
|
|
2854
|
+
|
|
2855
|
+
|
|
2856
|
+
class DiscussionUnanswered(DiscussionBase):
|
|
2857
|
+
"""Payload for github.discussion.unanswered events."""
|
|
2858
|
+
|
|
2859
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.unanswered"
|
|
2860
|
+
old_answer: dict[str, Any] = Field(
|
|
2861
|
+
description="Comment that was previously the answer"
|
|
2862
|
+
)
|
|
2863
|
+
|
|
2864
|
+
|
|
2865
|
+
class DiscussionUnlabeled(DiscussionBase):
|
|
2866
|
+
"""Payload for github.discussion.unlabeled events."""
|
|
2867
|
+
|
|
2868
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.unlabeled"
|
|
2869
|
+
label: GitHubLabel = Field(description="Label removed from the discussion")
|
|
2870
|
+
|
|
2871
|
+
|
|
2872
|
+
class DiscussionUnlocked(DiscussionBase):
|
|
2873
|
+
"""Payload for github.discussion.unlocked events."""
|
|
2874
|
+
|
|
2875
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.unlocked"
|
|
2876
|
+
|
|
2877
|
+
|
|
2878
|
+
class DiscussionUnpinned(DiscussionBase):
|
|
2879
|
+
"""Payload for github.discussion.unpinned events."""
|
|
2880
|
+
|
|
2881
|
+
_dispatch_topic: ClassVar[str] = "github.discussion.unpinned"
|
|
2882
|
+
|
|
2883
|
+
|
|
2884
|
+
# =============================================================================
|
|
2885
|
+
# Discussion Comment Event Payloads
|
|
2886
|
+
# =============================================================================
|
|
2887
|
+
|
|
2888
|
+
|
|
2889
|
+
class DiscussionCommentBase(GitHubEventPayload):
|
|
2890
|
+
"""Base class for discussion_comment.* events."""
|
|
2891
|
+
|
|
2892
|
+
action: str = Field(description="Event action: created, deleted, or edited")
|
|
2893
|
+
comment: dict[str, Any] = Field(description="Comment on the discussion")
|
|
2894
|
+
discussion: GitHubDiscussion = Field(
|
|
2895
|
+
description="Discussion the comment belongs to"
|
|
2896
|
+
)
|
|
2897
|
+
installation: dict[str, Any] = Field(
|
|
2898
|
+
description="GitHub App installation (required for discussion_comment events)"
|
|
2899
|
+
)
|
|
2900
|
+
|
|
2901
|
+
|
|
2902
|
+
class DiscussionCommentCreated(DiscussionCommentBase):
|
|
2903
|
+
"""Payload for github.discussion_comment.created events."""
|
|
2904
|
+
|
|
2905
|
+
_dispatch_topic: ClassVar[str] = "github.discussion_comment.created"
|
|
2906
|
+
|
|
2907
|
+
|
|
2908
|
+
class DiscussionCommentDeleted(DiscussionCommentBase):
|
|
2909
|
+
"""Payload for github.discussion_comment.deleted events."""
|
|
2910
|
+
|
|
2911
|
+
_dispatch_topic: ClassVar[str] = "github.discussion_comment.deleted"
|
|
2912
|
+
|
|
2913
|
+
|
|
2914
|
+
class DiscussionCommentEdited(DiscussionCommentBase):
|
|
2915
|
+
"""Payload for github.discussion_comment.edited events."""
|
|
2916
|
+
|
|
2917
|
+
_dispatch_topic: ClassVar[str] = "github.discussion_comment.edited"
|
|
2918
|
+
changes: GitHubChanges = Field(description="Changes made to the comment")
|
|
2919
|
+
|
|
2920
|
+
|
|
2921
|
+
# =============================================================================
|
|
2922
|
+
# Team Event Payloads
|
|
2923
|
+
# =============================================================================
|
|
2924
|
+
|
|
2925
|
+
|
|
2926
|
+
class GitHubTeam(GitHubModel):
|
|
2927
|
+
"""GitHub team."""
|
|
2928
|
+
|
|
2929
|
+
id: int = Field(description="Unique numeric ID")
|
|
2930
|
+
node_id: str = Field(description="GraphQL node ID")
|
|
2931
|
+
name: str = Field(description="Team name")
|
|
2932
|
+
slug: str = Field(description="URL-friendly team name")
|
|
2933
|
+
description: str | None = Field(default=None, description="Team description")
|
|
2934
|
+
privacy: str = Field(description="Team privacy: closed or secret")
|
|
2935
|
+
permission: str = Field(description="Default permission: pull, push, or admin")
|
|
2936
|
+
url: str = Field(description="API URL")
|
|
2937
|
+
html_url: str = Field(description="Web URL")
|
|
2938
|
+
members_url: str = Field(description="API URL for members")
|
|
2939
|
+
repositories_url: str = Field(description="API URL for repositories")
|
|
2940
|
+
|
|
2941
|
+
|
|
2942
|
+
class TeamBase(GitHubEventPayload):
|
|
2943
|
+
"""Base class for team.* events.
|
|
2944
|
+
|
|
2945
|
+
Triggered when a team is created, deleted, edited, or when
|
|
2946
|
+
repositories are added or removed from the team.
|
|
2947
|
+
"""
|
|
2948
|
+
|
|
2949
|
+
action: str = Field(
|
|
2950
|
+
description="Event action: added_to_repository, created, deleted, "
|
|
2951
|
+
"edited, or removed_from_repository"
|
|
2952
|
+
)
|
|
2953
|
+
team: GitHubTeam = Field(description="Team that triggered the event")
|
|
2954
|
+
|
|
2955
|
+
|
|
2956
|
+
class TeamAddedToRepository(TeamBase):
|
|
2957
|
+
"""Payload for github.team.added_to_repository events."""
|
|
2958
|
+
|
|
2959
|
+
_dispatch_topic: ClassVar[str] = "github.team.added_to_repository"
|
|
2960
|
+
|
|
2961
|
+
|
|
2962
|
+
class TeamCreated(TeamBase):
|
|
2963
|
+
"""Payload for github.team.created events."""
|
|
2964
|
+
|
|
2965
|
+
_dispatch_topic: ClassVar[str] = "github.team.created"
|
|
2966
|
+
|
|
2967
|
+
|
|
2968
|
+
class TeamDeleted(TeamBase):
|
|
2969
|
+
"""Payload for github.team.deleted events."""
|
|
2970
|
+
|
|
2971
|
+
_dispatch_topic: ClassVar[str] = "github.team.deleted"
|
|
2972
|
+
|
|
2973
|
+
|
|
2974
|
+
class TeamEdited(TeamBase):
|
|
2975
|
+
"""Payload for github.team.edited events."""
|
|
2976
|
+
|
|
2977
|
+
_dispatch_topic: ClassVar[str] = "github.team.edited"
|
|
2978
|
+
changes: GitHubChanges = Field(description="Changes made to the team")
|
|
2979
|
+
|
|
2980
|
+
|
|
2981
|
+
class TeamRemovedFromRepository(TeamBase):
|
|
2982
|
+
"""Payload for github.team.removed_from_repository events."""
|
|
2983
|
+
|
|
2984
|
+
_dispatch_topic: ClassVar[str] = "github.team.removed_from_repository"
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
# =============================================================================
|
|
2988
|
+
# Organization Event Payloads
|
|
2989
|
+
# =============================================================================
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
class OrganizationBase(GitHubEventPayload):
|
|
2993
|
+
"""Base class for organization.* events.
|
|
2994
|
+
|
|
2995
|
+
Triggered when membership in an organization changes.
|
|
2996
|
+
"""
|
|
2997
|
+
|
|
2998
|
+
action: str = Field(
|
|
2999
|
+
description="Event action: deleted, member_added, member_invited, "
|
|
3000
|
+
"member_removed, or renamed"
|
|
3001
|
+
)
|
|
3002
|
+
membership: dict[str, Any] | None = Field(
|
|
3003
|
+
default=None,
|
|
3004
|
+
description="Membership details (present for member_added/removed events)",
|
|
3005
|
+
)
|
|
3006
|
+
invitation: dict[str, Any] | None = Field(
|
|
3007
|
+
default=None,
|
|
3008
|
+
description="Invitation details (present for member_invited events)",
|
|
3009
|
+
)
|
|
3010
|
+
|
|
3011
|
+
|
|
3012
|
+
class OrganizationDeleted(OrganizationBase):
|
|
3013
|
+
"""Payload for github.organization.deleted events."""
|
|
3014
|
+
|
|
3015
|
+
_dispatch_topic: ClassVar[str] = "github.organization.deleted"
|
|
3016
|
+
|
|
3017
|
+
|
|
3018
|
+
class OrganizationMemberAdded(OrganizationBase):
|
|
3019
|
+
"""Payload for github.organization.member_added events."""
|
|
3020
|
+
|
|
3021
|
+
_dispatch_topic: ClassVar[str] = "github.organization.member_added"
|
|
3022
|
+
|
|
3023
|
+
|
|
3024
|
+
class OrganizationMemberInvited(OrganizationBase):
|
|
3025
|
+
"""Payload for github.organization.member_invited events."""
|
|
3026
|
+
|
|
3027
|
+
_dispatch_topic: ClassVar[str] = "github.organization.member_invited"
|
|
3028
|
+
user: GitHubUser = Field(description="User who was invited")
|
|
3029
|
+
|
|
3030
|
+
|
|
3031
|
+
class OrganizationMemberRemoved(OrganizationBase):
|
|
3032
|
+
"""Payload for github.organization.member_removed events."""
|
|
3033
|
+
|
|
3034
|
+
_dispatch_topic: ClassVar[str] = "github.organization.member_removed"
|
|
3035
|
+
|
|
3036
|
+
|
|
3037
|
+
class OrganizationRenamed(OrganizationBase):
|
|
3038
|
+
"""Payload for github.organization.renamed events."""
|
|
3039
|
+
|
|
3040
|
+
_dispatch_topic: ClassVar[str] = "github.organization.renamed"
|
|
3041
|
+
changes: GitHubChanges = Field(description="Changes to the organization (old name)")
|
|
3042
|
+
|
|
3043
|
+
|
|
3044
|
+
# =============================================================================
|
|
3045
|
+
# Code Scanning Alert Event Payloads
|
|
3046
|
+
# =============================================================================
|
|
3047
|
+
|
|
3048
|
+
|
|
3049
|
+
class GitHubCodeScanningAlert(GitHubModel):
|
|
3050
|
+
"""A code scanning alert."""
|
|
3051
|
+
|
|
3052
|
+
number: int = Field(description="Alert number within the repository")
|
|
3053
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
3054
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
3055
|
+
url: str = Field(description="API URL for this alert")
|
|
3056
|
+
html_url: str = Field(description="Web URL for this alert")
|
|
3057
|
+
state: str = Field(description="Alert state: open, dismissed, or fixed")
|
|
3058
|
+
dismissed_by: GitHubUser | None = Field(
|
|
3059
|
+
default=None, description="User who dismissed the alert"
|
|
3060
|
+
)
|
|
3061
|
+
dismissed_at: str | None = Field(
|
|
3062
|
+
default=None, description="ISO8601 dismiss timestamp"
|
|
3063
|
+
)
|
|
3064
|
+
dismissed_reason: str | None = Field(
|
|
3065
|
+
default=None, description="Reason for dismissal"
|
|
3066
|
+
)
|
|
3067
|
+
rule: dict[str, Any] = Field(description="Rule that triggered the alert")
|
|
3068
|
+
tool: dict[str, Any] = Field(description="Tool that generated the alert")
|
|
3069
|
+
most_recent_instance: dict[str, Any] = Field(
|
|
3070
|
+
description="Most recent instance of this alert"
|
|
3071
|
+
)
|
|
3072
|
+
|
|
3073
|
+
|
|
3074
|
+
class CodeScanningAlertBase(GitHubEventPayload):
|
|
3075
|
+
"""Base class for code_scanning_alert.* events."""
|
|
3076
|
+
|
|
3077
|
+
action: str = Field(
|
|
3078
|
+
description="Event action: appeared_in_branch, closed_by_user, created, "
|
|
3079
|
+
"fixed, reopened, or reopened_by_user"
|
|
3080
|
+
)
|
|
3081
|
+
alert: GitHubCodeScanningAlert = Field(description="Code scanning alert data")
|
|
3082
|
+
ref: str = Field(description="Git ref the alert applies to")
|
|
3083
|
+
commit_oid: str = Field(description="Commit OID the alert applies to")
|
|
3084
|
+
|
|
3085
|
+
|
|
3086
|
+
class CodeScanningAlertAppearedInBranch(CodeScanningAlertBase):
|
|
3087
|
+
"""Payload for github.code_scanning_alert.appeared_in_branch events."""
|
|
3088
|
+
|
|
3089
|
+
_dispatch_topic: ClassVar[str] = "github.code_scanning_alert.appeared_in_branch"
|
|
3090
|
+
|
|
3091
|
+
|
|
3092
|
+
class CodeScanningAlertClosedByUser(CodeScanningAlertBase):
|
|
3093
|
+
"""Payload for github.code_scanning_alert.closed_by_user events."""
|
|
3094
|
+
|
|
3095
|
+
_dispatch_topic: ClassVar[str] = "github.code_scanning_alert.closed_by_user"
|
|
3096
|
+
|
|
3097
|
+
|
|
3098
|
+
class CodeScanningAlertCreated(CodeScanningAlertBase):
|
|
3099
|
+
"""Payload for github.code_scanning_alert.created events."""
|
|
3100
|
+
|
|
3101
|
+
_dispatch_topic: ClassVar[str] = "github.code_scanning_alert.created"
|
|
3102
|
+
|
|
3103
|
+
|
|
3104
|
+
class CodeScanningAlertFixed(CodeScanningAlertBase):
|
|
3105
|
+
"""Payload for github.code_scanning_alert.fixed events."""
|
|
3106
|
+
|
|
3107
|
+
_dispatch_topic: ClassVar[str] = "github.code_scanning_alert.fixed"
|
|
3108
|
+
|
|
3109
|
+
|
|
3110
|
+
class CodeScanningAlertReopened(CodeScanningAlertBase):
|
|
3111
|
+
"""Payload for github.code_scanning_alert.reopened events."""
|
|
3112
|
+
|
|
3113
|
+
_dispatch_topic: ClassVar[str] = "github.code_scanning_alert.reopened"
|
|
3114
|
+
|
|
3115
|
+
|
|
3116
|
+
class CodeScanningAlertReopenedByUser(CodeScanningAlertBase):
|
|
3117
|
+
"""Payload for github.code_scanning_alert.reopened_by_user events."""
|
|
3118
|
+
|
|
3119
|
+
_dispatch_topic: ClassVar[str] = "github.code_scanning_alert.reopened_by_user"
|
|
3120
|
+
|
|
3121
|
+
|
|
3122
|
+
# =============================================================================
|
|
3123
|
+
# Secret Scanning Alert Event Payloads
|
|
3124
|
+
# =============================================================================
|
|
3125
|
+
|
|
3126
|
+
|
|
3127
|
+
class GitHubSecretScanningAlert(GitHubModel):
|
|
3128
|
+
"""A secret scanning alert."""
|
|
3129
|
+
|
|
3130
|
+
number: int = Field(description="Alert number within the repository")
|
|
3131
|
+
created_at: str = Field(description="ISO8601 creation timestamp")
|
|
3132
|
+
updated_at: str | None = Field(default=None, description="ISO8601 update timestamp")
|
|
3133
|
+
url: str = Field(description="API URL for this alert")
|
|
3134
|
+
html_url: str = Field(description="Web URL for this alert")
|
|
3135
|
+
locations_url: str = Field(description="API URL to list alert locations")
|
|
3136
|
+
state: str = Field(description="Alert state: open or resolved")
|
|
3137
|
+
resolution: str | None = Field(
|
|
3138
|
+
default=None,
|
|
3139
|
+
description="Reason for resolution: false_positive, wont_fix, "
|
|
3140
|
+
"revoked, used_in_tests, or pattern_deleted",
|
|
3141
|
+
)
|
|
3142
|
+
resolved_at: str | None = Field(
|
|
3143
|
+
default=None, description="ISO8601 resolution timestamp"
|
|
3144
|
+
)
|
|
3145
|
+
resolved_by: GitHubUser | None = Field(
|
|
3146
|
+
default=None, description="User who resolved the alert"
|
|
3147
|
+
)
|
|
3148
|
+
secret_type: str = Field(description="Type of secret detected")
|
|
3149
|
+
secret_type_display_name: str | None = Field(
|
|
3150
|
+
default=None, description="Human-readable name of the secret type"
|
|
3151
|
+
)
|
|
3152
|
+
secret: str | None = Field(default=None, description="The detected secret value")
|
|
3153
|
+
push_protection_bypassed: bool | None = Field(
|
|
3154
|
+
default=None, description="Whether push protection was bypassed for this secret"
|
|
3155
|
+
)
|
|
3156
|
+
push_protection_bypassed_by: GitHubUser | None = Field(
|
|
3157
|
+
default=None, description="User who bypassed push protection"
|
|
3158
|
+
)
|
|
3159
|
+
push_protection_bypassed_at: str | None = Field(
|
|
3160
|
+
default=None, description="ISO8601 timestamp when push protection was bypassed"
|
|
3161
|
+
)
|
|
3162
|
+
|
|
3163
|
+
|
|
3164
|
+
class SecretScanningAlertBase(GitHubEventPayload):
|
|
3165
|
+
"""Base class for secret_scanning_alert.* events."""
|
|
3166
|
+
|
|
3167
|
+
action: str = Field(
|
|
3168
|
+
description="Event action: created, reopened, resolved, or revoked"
|
|
3169
|
+
)
|
|
3170
|
+
alert: GitHubSecretScanningAlert = Field(description="Secret scanning alert data")
|
|
3171
|
+
|
|
3172
|
+
|
|
3173
|
+
class SecretScanningAlertCreated(SecretScanningAlertBase):
|
|
3174
|
+
"""Payload for github.secret_scanning_alert.created events."""
|
|
3175
|
+
|
|
3176
|
+
_dispatch_topic: ClassVar[str] = "github.secret_scanning_alert.created"
|
|
3177
|
+
|
|
3178
|
+
|
|
3179
|
+
class SecretScanningAlertReopened(SecretScanningAlertBase):
|
|
3180
|
+
"""Payload for github.secret_scanning_alert.reopened events."""
|
|
3181
|
+
|
|
3182
|
+
_dispatch_topic: ClassVar[str] = "github.secret_scanning_alert.reopened"
|
|
3183
|
+
|
|
3184
|
+
|
|
3185
|
+
class SecretScanningAlertResolved(SecretScanningAlertBase):
|
|
3186
|
+
"""Payload for github.secret_scanning_alert.resolved events."""
|
|
3187
|
+
|
|
3188
|
+
_dispatch_topic: ClassVar[str] = "github.secret_scanning_alert.resolved"
|
|
3189
|
+
|
|
3190
|
+
|
|
3191
|
+
class SecretScanningAlertRevoked(SecretScanningAlertBase):
|
|
3192
|
+
"""Payload for github.secret_scanning_alert.revoked events."""
|
|
3193
|
+
|
|
3194
|
+
_dispatch_topic: ClassVar[str] = "github.secret_scanning_alert.revoked"
|
|
3195
|
+
|
|
3196
|
+
|
|
3197
|
+
# =============================================================================
|
|
3198
|
+
# Secret Scanning Alert Location Event Payloads
|
|
3199
|
+
# =============================================================================
|
|
3200
|
+
|
|
3201
|
+
|
|
3202
|
+
class SecretScanningAlertLocationBase(GitHubEventPayload):
|
|
3203
|
+
"""Base class for secret_scanning_alert_location.* events."""
|
|
3204
|
+
|
|
3205
|
+
action: str = Field(description="Event action: created")
|
|
3206
|
+
alert: GitHubSecretScanningAlert = Field(
|
|
3207
|
+
description="The alert the location belongs to"
|
|
3208
|
+
)
|
|
3209
|
+
location: dict[str, Any] = Field(description="Location data for the secret")
|
|
3210
|
+
|
|
3211
|
+
|
|
3212
|
+
class SecretScanningAlertLocationCreated(SecretScanningAlertLocationBase):
|
|
3213
|
+
"""Payload for github.secret_scanning_alert_location.created events."""
|
|
3214
|
+
|
|
3215
|
+
_dispatch_topic: ClassVar[str] = "github.secret_scanning_alert_location.created"
|
|
3216
|
+
|
|
3217
|
+
|
|
3218
|
+
# =============================================================================
|
|
3219
|
+
# Repository Vulnerability Alert Event Payloads
|
|
3220
|
+
# =============================================================================
|
|
3221
|
+
|
|
3222
|
+
|
|
3223
|
+
class RepositoryVulnerabilityAlertBase(GitHubEventPayload):
|
|
3224
|
+
"""Base class for repository_vulnerability_alert.* events.
|
|
3225
|
+
|
|
3226
|
+
Triggered when a vulnerability alert is created, dismissed, reopened,
|
|
3227
|
+
or resolved. Note: action values use non-standard names (create/dismiss
|
|
3228
|
+
instead of created/dismissed).
|
|
3229
|
+
"""
|
|
3230
|
+
|
|
3231
|
+
action: str = Field(description="Event action: create, dismiss, reopen, or resolve")
|
|
3232
|
+
alert: dict[str, Any] = Field(description="Vulnerability alert data")
|
|
3233
|
+
|
|
3234
|
+
|
|
3235
|
+
class RepositoryVulnerabilityAlertCreate(RepositoryVulnerabilityAlertBase):
|
|
3236
|
+
"""Payload for github.repository_vulnerability_alert.create events."""
|
|
3237
|
+
|
|
3238
|
+
_dispatch_topic: ClassVar[str] = "github.repository_vulnerability_alert.create"
|
|
3239
|
+
|
|
3240
|
+
|
|
3241
|
+
class RepositoryVulnerabilityAlertDismiss(RepositoryVulnerabilityAlertBase):
|
|
3242
|
+
"""Payload for github.repository_vulnerability_alert.dismiss events."""
|
|
3243
|
+
|
|
3244
|
+
_dispatch_topic: ClassVar[str] = "github.repository_vulnerability_alert.dismiss"
|
|
3245
|
+
|
|
3246
|
+
|
|
3247
|
+
class RepositoryVulnerabilityAlertReopen(RepositoryVulnerabilityAlertBase):
|
|
3248
|
+
"""Payload for github.repository_vulnerability_alert.reopen events."""
|
|
3249
|
+
|
|
3250
|
+
_dispatch_topic: ClassVar[str] = "github.repository_vulnerability_alert.reopen"
|
|
3251
|
+
|
|
3252
|
+
|
|
3253
|
+
class RepositoryVulnerabilityAlertResolve(RepositoryVulnerabilityAlertBase):
|
|
3254
|
+
"""Payload for github.repository_vulnerability_alert.resolve events."""
|
|
3255
|
+
|
|
3256
|
+
_dispatch_topic: ClassVar[str] = "github.repository_vulnerability_alert.resolve"
|
|
3257
|
+
|
|
3258
|
+
|
|
3259
|
+
# =============================================================================
|
|
3260
|
+
# Security Advisory Event Payloads
|
|
3261
|
+
# =============================================================================
|
|
3262
|
+
|
|
3263
|
+
|
|
3264
|
+
class SecurityAdvisoryBase(GitHubEventPayload):
|
|
3265
|
+
"""Base class for security_advisory.* events.
|
|
3266
|
+
|
|
3267
|
+
Triggered when a GitHub Security Advisory is published, updated,
|
|
3268
|
+
performed, or withdrawn.
|
|
3269
|
+
"""
|
|
3270
|
+
|
|
3271
|
+
action: str = Field(
|
|
3272
|
+
description="Event action: performed, published, updated, or withdrawn"
|
|
3273
|
+
)
|
|
3274
|
+
security_advisory: dict[str, Any] = Field(
|
|
3275
|
+
description="Security advisory data including CVE info, severity, and affected packages"
|
|
3276
|
+
)
|
|
3277
|
+
|
|
3278
|
+
|
|
3279
|
+
class SecurityAdvisoryPerformed(SecurityAdvisoryBase):
|
|
3280
|
+
"""Payload for github.security_advisory.performed events."""
|
|
3281
|
+
|
|
3282
|
+
_dispatch_topic: ClassVar[str] = "github.security_advisory.performed"
|
|
3283
|
+
|
|
3284
|
+
|
|
3285
|
+
class SecurityAdvisoryPublished(SecurityAdvisoryBase):
|
|
3286
|
+
"""Payload for github.security_advisory.published events."""
|
|
3287
|
+
|
|
3288
|
+
_dispatch_topic: ClassVar[str] = "github.security_advisory.published"
|
|
3289
|
+
|
|
3290
|
+
|
|
3291
|
+
class SecurityAdvisoryUpdated(SecurityAdvisoryBase):
|
|
3292
|
+
"""Payload for github.security_advisory.updated events."""
|
|
3293
|
+
|
|
3294
|
+
_dispatch_topic: ClassVar[str] = "github.security_advisory.updated"
|
|
3295
|
+
|
|
3296
|
+
|
|
3297
|
+
class SecurityAdvisoryWithdrawn(SecurityAdvisoryBase):
|
|
3298
|
+
"""Payload for github.security_advisory.withdrawn events."""
|
|
3299
|
+
|
|
3300
|
+
_dispatch_topic: ClassVar[str] = "github.security_advisory.withdrawn"
|
|
3301
|
+
|
|
3302
|
+
|
|
3303
|
+
# =============================================================================
|
|
3304
|
+
# Marketplace Purchase Event Payloads
|
|
3305
|
+
# =============================================================================
|
|
3306
|
+
|
|
3307
|
+
|
|
3308
|
+
class MarketplacePurchaseBase(GitHubEventPayload):
|
|
3309
|
+
"""Base class for marketplace_purchase.* events.
|
|
3310
|
+
|
|
3311
|
+
Triggered when a GitHub Marketplace purchase is made or changed.
|
|
3312
|
+
"""
|
|
3313
|
+
|
|
3314
|
+
action: str = Field(
|
|
3315
|
+
description="Event action: cancelled, changed, pending_change, "
|
|
3316
|
+
"pending_change_cancelled, or purchased"
|
|
3317
|
+
)
|
|
3318
|
+
effective_date: str = Field(description="ISO8601 date when the change takes effect")
|
|
3319
|
+
marketplace_purchase: dict[str, Any] = Field(
|
|
3320
|
+
description="Marketplace purchase details including plan and billing cycle"
|
|
3321
|
+
)
|
|
3322
|
+
previous_marketplace_purchase: dict[str, Any] | None = Field(
|
|
3323
|
+
default=None,
|
|
3324
|
+
description="Previous marketplace purchase (present for change events)",
|
|
3325
|
+
)
|
|
3326
|
+
|
|
3327
|
+
|
|
3328
|
+
class MarketplacePurchaseCancelled(MarketplacePurchaseBase):
|
|
3329
|
+
"""Payload for github.marketplace_purchase.cancelled events."""
|
|
3330
|
+
|
|
3331
|
+
_dispatch_topic: ClassVar[str] = "github.marketplace_purchase.cancelled"
|
|
3332
|
+
|
|
3333
|
+
|
|
3334
|
+
class MarketplacePurchaseChanged(MarketplacePurchaseBase):
|
|
3335
|
+
"""Payload for github.marketplace_purchase.changed events."""
|
|
3336
|
+
|
|
3337
|
+
_dispatch_topic: ClassVar[str] = "github.marketplace_purchase.changed"
|
|
3338
|
+
|
|
3339
|
+
|
|
3340
|
+
class MarketplacePurchasePendingChange(MarketplacePurchaseBase):
|
|
3341
|
+
"""Payload for github.marketplace_purchase.pending_change events."""
|
|
3342
|
+
|
|
3343
|
+
_dispatch_topic: ClassVar[str] = "github.marketplace_purchase.pending_change"
|
|
3344
|
+
|
|
3345
|
+
|
|
3346
|
+
class MarketplacePurchasePendingChangeCancelled(MarketplacePurchaseBase):
|
|
3347
|
+
"""Payload for github.marketplace_purchase.pending_change_cancelled events."""
|
|
3348
|
+
|
|
3349
|
+
_dispatch_topic: ClassVar[str] = (
|
|
3350
|
+
"github.marketplace_purchase.pending_change_cancelled"
|
|
3351
|
+
)
|
|
3352
|
+
|
|
3353
|
+
|
|
3354
|
+
class MarketplacePurchasePurchased(MarketplacePurchaseBase):
|
|
3355
|
+
"""Payload for github.marketplace_purchase.purchased events."""
|
|
3356
|
+
|
|
3357
|
+
_dispatch_topic: ClassVar[str] = "github.marketplace_purchase.purchased"
|
|
3358
|
+
|
|
3359
|
+
|
|
3360
|
+
# =============================================================================
|
|
3361
|
+
# Package Event Payloads
|
|
3362
|
+
# =============================================================================
|
|
3363
|
+
|
|
3364
|
+
|
|
3365
|
+
class PackageBase(GitHubEventPayload):
|
|
3366
|
+
"""Base class for package.* events.
|
|
3367
|
+
|
|
3368
|
+
Triggered when a GitHub Packages package is published or updated.
|
|
3369
|
+
"""
|
|
3370
|
+
|
|
3371
|
+
action: str = Field(description="Event action: published or updated")
|
|
3372
|
+
package: dict[str, Any] = Field(description="Package data")
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
class PackagePublished(PackageBase):
|
|
3376
|
+
"""Payload for github.package.published events."""
|
|
3377
|
+
|
|
3378
|
+
_dispatch_topic: ClassVar[str] = "github.package.published"
|
|
3379
|
+
|
|
3380
|
+
|
|
3381
|
+
class PackageUpdated(PackageBase):
|
|
3382
|
+
"""Payload for github.package.updated events."""
|
|
3383
|
+
|
|
3384
|
+
_dispatch_topic: ClassVar[str] = "github.package.updated"
|
|
3385
|
+
|
|
3386
|
+
|
|
3387
|
+
# =============================================================================
|
|
3388
|
+
# Registry Package Event Payloads
|
|
3389
|
+
# =============================================================================
|
|
3390
|
+
|
|
3391
|
+
|
|
3392
|
+
class RegistryPackageBase(GitHubEventPayload):
|
|
3393
|
+
"""Base class for registry_package.* events.
|
|
3394
|
+
|
|
3395
|
+
Triggered when a package is published or updated in the GitHub Container
|
|
3396
|
+
Registry (ghcr.io).
|
|
3397
|
+
"""
|
|
3398
|
+
|
|
3399
|
+
action: str = Field(description="Event action: published or updated")
|
|
3400
|
+
registry_package: dict[str, Any] = Field(description="Registry package data")
|
|
3401
|
+
|
|
3402
|
+
|
|
3403
|
+
class RegistryPackagePublished(RegistryPackageBase):
|
|
3404
|
+
"""Payload for github.registry_package.published events."""
|
|
3405
|
+
|
|
3406
|
+
_dispatch_topic: ClassVar[str] = "github.registry_package.published"
|
|
3407
|
+
|
|
3408
|
+
|
|
3409
|
+
class RegistryPackageUpdated(RegistryPackageBase):
|
|
3410
|
+
"""Payload for github.registry_package.updated events."""
|
|
3411
|
+
|
|
3412
|
+
_dispatch_topic: ClassVar[str] = "github.registry_package.updated"
|
|
3413
|
+
|
|
3414
|
+
|
|
3415
|
+
# =============================================================================
|
|
3416
|
+
# Project Event Payloads (classic Projects)
|
|
3417
|
+
# =============================================================================
|
|
3418
|
+
|
|
3419
|
+
|
|
3420
|
+
class ProjectBase(GitHubEventPayload):
|
|
3421
|
+
"""Base class for project.* events (GitHub Classic Projects).
|
|
3422
|
+
|
|
3423
|
+
Triggered when a project board is created, closed, deleted, edited,
|
|
3424
|
+
or reopened.
|
|
3425
|
+
"""
|
|
3426
|
+
|
|
3427
|
+
action: str = Field(
|
|
3428
|
+
description="Event action: closed, created, deleted, edited, or reopened"
|
|
3429
|
+
)
|
|
3430
|
+
project: dict[str, Any] = Field(description="Project board data")
|
|
3431
|
+
|
|
3432
|
+
|
|
3433
|
+
class ProjectClosed(ProjectBase):
|
|
3434
|
+
"""Payload for github.project.closed events."""
|
|
3435
|
+
|
|
3436
|
+
_dispatch_topic: ClassVar[str] = "github.project.closed"
|
|
3437
|
+
|
|
3438
|
+
|
|
3439
|
+
class ProjectCreated(ProjectBase):
|
|
3440
|
+
"""Payload for github.project.created events."""
|
|
3441
|
+
|
|
3442
|
+
_dispatch_topic: ClassVar[str] = "github.project.created"
|
|
3443
|
+
|
|
3444
|
+
|
|
3445
|
+
class ProjectDeleted(ProjectBase):
|
|
3446
|
+
"""Payload for github.project.deleted events."""
|
|
3447
|
+
|
|
3448
|
+
_dispatch_topic: ClassVar[str] = "github.project.deleted"
|
|
3449
|
+
|
|
3450
|
+
|
|
3451
|
+
class ProjectEdited(ProjectBase):
|
|
3452
|
+
"""Payload for github.project.edited events."""
|
|
3453
|
+
|
|
3454
|
+
_dispatch_topic: ClassVar[str] = "github.project.edited"
|
|
3455
|
+
changes: GitHubChanges | None = Field(
|
|
3456
|
+
default=None, description="Changes made to the project"
|
|
3457
|
+
)
|
|
3458
|
+
|
|
3459
|
+
|
|
3460
|
+
class ProjectReopened(ProjectBase):
|
|
3461
|
+
"""Payload for github.project.reopened events."""
|
|
3462
|
+
|
|
3463
|
+
_dispatch_topic: ClassVar[str] = "github.project.reopened"
|
|
3464
|
+
|
|
3465
|
+
|
|
3466
|
+
# =============================================================================
|
|
3467
|
+
# Project Card Event Payloads (classic Projects)
|
|
3468
|
+
# =============================================================================
|
|
3469
|
+
|
|
3470
|
+
|
|
3471
|
+
class ProjectCardBase(GitHubEventPayload):
|
|
3472
|
+
"""Base class for project_card.* events (GitHub Classic Projects).
|
|
3473
|
+
|
|
3474
|
+
Triggered when a project card is converted, created, deleted, edited,
|
|
3475
|
+
or moved.
|
|
3476
|
+
"""
|
|
3477
|
+
|
|
3478
|
+
action: str = Field(
|
|
3479
|
+
description="Event action: converted, created, deleted, edited, or moved"
|
|
3480
|
+
)
|
|
3481
|
+
project_card: dict[str, Any] = Field(description="Project card data")
|
|
3482
|
+
|
|
3483
|
+
|
|
3484
|
+
class ProjectCardConverted(ProjectCardBase):
|
|
3485
|
+
"""Payload for github.project_card.converted events."""
|
|
3486
|
+
|
|
3487
|
+
_dispatch_topic: ClassVar[str] = "github.project_card.converted"
|
|
3488
|
+
changes: dict[str, Any] = Field(
|
|
3489
|
+
description="Changes made to the project card (previous note value)"
|
|
3490
|
+
)
|
|
3491
|
+
|
|
3492
|
+
|
|
3493
|
+
class ProjectCardCreated(ProjectCardBase):
|
|
3494
|
+
"""Payload for github.project_card.created events."""
|
|
3495
|
+
|
|
3496
|
+
_dispatch_topic: ClassVar[str] = "github.project_card.created"
|
|
3497
|
+
|
|
3498
|
+
|
|
3499
|
+
class ProjectCardDeleted(ProjectCardBase):
|
|
3500
|
+
"""Payload for github.project_card.deleted events."""
|
|
3501
|
+
|
|
3502
|
+
_dispatch_topic: ClassVar[str] = "github.project_card.deleted"
|
|
3503
|
+
|
|
3504
|
+
|
|
3505
|
+
class ProjectCardEdited(ProjectCardBase):
|
|
3506
|
+
"""Payload for github.project_card.edited events."""
|
|
3507
|
+
|
|
3508
|
+
_dispatch_topic: ClassVar[str] = "github.project_card.edited"
|
|
3509
|
+
changes: dict[str, Any] = Field(description="Changes made to the project card")
|
|
3510
|
+
|
|
3511
|
+
|
|
3512
|
+
class ProjectCardMoved(ProjectCardBase):
|
|
3513
|
+
"""Payload for github.project_card.moved events."""
|
|
3514
|
+
|
|
3515
|
+
_dispatch_topic: ClassVar[str] = "github.project_card.moved"
|
|
3516
|
+
|
|
3517
|
+
|
|
3518
|
+
# =============================================================================
|
|
3519
|
+
# Project Column Event Payloads (classic Projects)
|
|
3520
|
+
# =============================================================================
|
|
3521
|
+
|
|
3522
|
+
|
|
3523
|
+
class ProjectColumnBase(GitHubEventPayload):
|
|
3524
|
+
"""Base class for project_column.* events (GitHub Classic Projects).
|
|
3525
|
+
|
|
3526
|
+
Triggered when a project column is created, deleted, edited, or moved.
|
|
3527
|
+
"""
|
|
3528
|
+
|
|
3529
|
+
action: str = Field(description="Event action: created, deleted, edited, or moved")
|
|
3530
|
+
project_column: dict[str, Any] = Field(description="Project column data")
|
|
3531
|
+
|
|
3532
|
+
|
|
3533
|
+
class ProjectColumnCreated(ProjectColumnBase):
|
|
3534
|
+
"""Payload for github.project_column.created events."""
|
|
3535
|
+
|
|
3536
|
+
_dispatch_topic: ClassVar[str] = "github.project_column.created"
|
|
3537
|
+
|
|
3538
|
+
|
|
3539
|
+
class ProjectColumnDeleted(ProjectColumnBase):
|
|
3540
|
+
"""Payload for github.project_column.deleted events."""
|
|
3541
|
+
|
|
3542
|
+
_dispatch_topic: ClassVar[str] = "github.project_column.deleted"
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
class ProjectColumnEdited(ProjectColumnBase):
|
|
3546
|
+
"""Payload for github.project_column.edited events."""
|
|
3547
|
+
|
|
3548
|
+
_dispatch_topic: ClassVar[str] = "github.project_column.edited"
|
|
3549
|
+
changes: dict[str, Any] = Field(description="Changes made to the project column")
|
|
3550
|
+
|
|
3551
|
+
|
|
3552
|
+
class ProjectColumnMoved(ProjectColumnBase):
|
|
3553
|
+
"""Payload for github.project_column.moved events."""
|
|
3554
|
+
|
|
3555
|
+
_dispatch_topic: ClassVar[str] = "github.project_column.moved"
|
|
3556
|
+
|
|
3557
|
+
|
|
3558
|
+
# =============================================================================
|
|
3559
|
+
# Projects V2 Item Event Payloads (new Projects)
|
|
3560
|
+
# =============================================================================
|
|
3561
|
+
|
|
3562
|
+
|
|
3563
|
+
class ProjectsV2ItemBase(GitHubEventPayload):
|
|
3564
|
+
"""Base class for projects_v2_item.* events (GitHub Projects, new version).
|
|
3565
|
+
|
|
3566
|
+
Triggered when a project item is archived, converted, created, deleted,
|
|
3567
|
+
edited, reordered, or restored.
|
|
3568
|
+
"""
|
|
3569
|
+
|
|
3570
|
+
action: str = Field(
|
|
3571
|
+
description="Event action: archived, converted, created, deleted, "
|
|
3572
|
+
"edited, reordered, or restored"
|
|
3573
|
+
)
|
|
3574
|
+
projects_v2_item: dict[str, Any] = Field(description="Projects V2 item data")
|
|
3575
|
+
|
|
3576
|
+
|
|
3577
|
+
class ProjectsV2ItemArchived(ProjectsV2ItemBase):
|
|
3578
|
+
"""Payload for github.projects_v2_item.archived events."""
|
|
3579
|
+
|
|
3580
|
+
_dispatch_topic: ClassVar[str] = "github.projects_v2_item.archived"
|
|
3581
|
+
changes: dict[str, Any] = Field(description="Changes made to the project item")
|
|
3582
|
+
|
|
3583
|
+
|
|
3584
|
+
class ProjectsV2ItemConverted(ProjectsV2ItemBase):
|
|
3585
|
+
"""Payload for github.projects_v2_item.converted events."""
|
|
3586
|
+
|
|
3587
|
+
_dispatch_topic: ClassVar[str] = "github.projects_v2_item.converted"
|
|
3588
|
+
changes: dict[str, Any] = Field(description="Changes made to the project item")
|
|
3589
|
+
|
|
3590
|
+
|
|
3591
|
+
class ProjectsV2ItemCreated(ProjectsV2ItemBase):
|
|
3592
|
+
"""Payload for github.projects_v2_item.created events."""
|
|
3593
|
+
|
|
3594
|
+
_dispatch_topic: ClassVar[str] = "github.projects_v2_item.created"
|
|
3595
|
+
|
|
3596
|
+
|
|
3597
|
+
class ProjectsV2ItemDeleted(ProjectsV2ItemBase):
|
|
3598
|
+
"""Payload for github.projects_v2_item.deleted events."""
|
|
3599
|
+
|
|
3600
|
+
_dispatch_topic: ClassVar[str] = "github.projects_v2_item.deleted"
|
|
3601
|
+
|
|
3602
|
+
|
|
3603
|
+
class ProjectsV2ItemEdited(ProjectsV2ItemBase):
|
|
3604
|
+
"""Payload for github.projects_v2_item.edited events."""
|
|
3605
|
+
|
|
3606
|
+
_dispatch_topic: ClassVar[str] = "github.projects_v2_item.edited"
|
|
3607
|
+
changes: dict[str, Any] = Field(description="Changes made to the project item")
|
|
3608
|
+
|
|
3609
|
+
|
|
3610
|
+
class ProjectsV2ItemReordered(ProjectsV2ItemBase):
|
|
3611
|
+
"""Payload for github.projects_v2_item.reordered events."""
|
|
3612
|
+
|
|
3613
|
+
_dispatch_topic: ClassVar[str] = "github.projects_v2_item.reordered"
|
|
3614
|
+
changes: dict[str, Any] = Field(description="Changes made to the project item")
|
|
3615
|
+
|
|
3616
|
+
|
|
3617
|
+
class ProjectsV2ItemRestored(ProjectsV2ItemBase):
|
|
3618
|
+
"""Payload for github.projects_v2_item.restored events."""
|
|
3619
|
+
|
|
3620
|
+
_dispatch_topic: ClassVar[str] = "github.projects_v2_item.restored"
|
|
3621
|
+
changes: dict[str, Any] = Field(description="Changes made to the project item")
|
|
3622
|
+
|
|
3623
|
+
|
|
3624
|
+
# =============================================================================
|
|
3625
|
+
# Sponsorship Event Payloads
|
|
3626
|
+
# =============================================================================
|
|
3627
|
+
|
|
3628
|
+
|
|
3629
|
+
class SponsorshipBase(GitHubEventPayload):
|
|
3630
|
+
"""Base class for sponsorship.* events.
|
|
3631
|
+
|
|
3632
|
+
Triggered when a sponsorship is created, cancelled, edited,
|
|
3633
|
+
or when pending changes occur.
|
|
3634
|
+
"""
|
|
3635
|
+
|
|
3636
|
+
action: str = Field(
|
|
3637
|
+
description="Event action: cancelled, created, edited, "
|
|
3638
|
+
"pending_cancellation, pending_tier_change, or tier_changed"
|
|
3639
|
+
)
|
|
3640
|
+
sponsorship: dict[str, Any] = Field(description="Sponsorship details")
|
|
3641
|
+
|
|
3642
|
+
|
|
3643
|
+
class SponsorshipCancelled(SponsorshipBase):
|
|
3644
|
+
"""Payload for github.sponsorship.cancelled events."""
|
|
3645
|
+
|
|
3646
|
+
_dispatch_topic: ClassVar[str] = "github.sponsorship.cancelled"
|
|
3647
|
+
|
|
3648
|
+
|
|
3649
|
+
class SponsorshipCreated(SponsorshipBase):
|
|
3650
|
+
"""Payload for github.sponsorship.created events."""
|
|
3651
|
+
|
|
3652
|
+
_dispatch_topic: ClassVar[str] = "github.sponsorship.created"
|
|
3653
|
+
|
|
3654
|
+
|
|
3655
|
+
class SponsorshipEdited(SponsorshipBase):
|
|
3656
|
+
"""Payload for github.sponsorship.edited events."""
|
|
3657
|
+
|
|
3658
|
+
_dispatch_topic: ClassVar[str] = "github.sponsorship.edited"
|
|
3659
|
+
changes: GitHubChanges = Field(description="Changes made to the sponsorship")
|
|
3660
|
+
|
|
3661
|
+
|
|
3662
|
+
class SponsorshipPendingCancellation(SponsorshipBase):
|
|
3663
|
+
"""Payload for github.sponsorship.pending_cancellation events."""
|
|
3664
|
+
|
|
3665
|
+
_dispatch_topic: ClassVar[str] = "github.sponsorship.pending_cancellation"
|
|
3666
|
+
|
|
3667
|
+
|
|
3668
|
+
class SponsorshipPendingTierChange(SponsorshipBase):
|
|
3669
|
+
"""Payload for github.sponsorship.pending_tier_change events."""
|
|
3670
|
+
|
|
3671
|
+
_dispatch_topic: ClassVar[str] = "github.sponsorship.pending_tier_change"
|
|
3672
|
+
changes: GitHubChanges = Field(description="Pending tier change details")
|
|
3673
|
+
|
|
3674
|
+
|
|
3675
|
+
class SponsorshipTierChanged(SponsorshipBase):
|
|
3676
|
+
"""Payload for github.sponsorship.tier_changed events."""
|
|
3677
|
+
|
|
3678
|
+
_dispatch_topic: ClassVar[str] = "github.sponsorship.tier_changed"
|
|
3679
|
+
changes: GitHubChanges = Field(description="Tier change details")
|
|
3680
|
+
|
|
3681
|
+
|
|
3682
|
+
# =============================================================================
|
|
3683
|
+
# Custom Property Event Payloads
|
|
3684
|
+
# =============================================================================
|
|
3685
|
+
|
|
3686
|
+
|
|
3687
|
+
class CustomPropertyBase(GitHubEventPayload):
|
|
3688
|
+
"""Base class for custom_property.* events.
|
|
3689
|
+
|
|
3690
|
+
Triggered when a custom property definition is created or deleted
|
|
3691
|
+
at the organization level.
|
|
3692
|
+
"""
|
|
3693
|
+
|
|
3694
|
+
action: str = Field(description="Event action: created or deleted")
|
|
3695
|
+
definition: dict[str, Any] = Field(description="Custom property definition data")
|
|
3696
|
+
|
|
3697
|
+
|
|
3698
|
+
class CustomPropertyCreated(CustomPropertyBase):
|
|
3699
|
+
"""Payload for github.custom_property.created events."""
|
|
3700
|
+
|
|
3701
|
+
_dispatch_topic: ClassVar[str] = "github.custom_property.created"
|
|
3702
|
+
|
|
3703
|
+
|
|
3704
|
+
class CustomPropertyDeleted(CustomPropertyBase):
|
|
3705
|
+
"""Payload for github.custom_property.deleted events."""
|
|
3706
|
+
|
|
3707
|
+
_dispatch_topic: ClassVar[str] = "github.custom_property.deleted"
|
|
3708
|
+
|
|
3709
|
+
|
|
3710
|
+
# =============================================================================
|
|
3711
|
+
# Custom Property Values Event Payloads
|
|
3712
|
+
# =============================================================================
|
|
3713
|
+
|
|
3714
|
+
|
|
3715
|
+
class CustomPropertyValuesBase(GitHubEventPayload):
|
|
3716
|
+
"""Base class for custom_property_values.* events.
|
|
3717
|
+
|
|
3718
|
+
Triggered when custom property values are updated for a repository.
|
|
3719
|
+
"""
|
|
3720
|
+
|
|
3721
|
+
action: str = Field(description="Event action: updated")
|
|
3722
|
+
new_property_values: list[dict[str, Any]] = Field(
|
|
3723
|
+
description="New custom property values after the update"
|
|
3724
|
+
)
|
|
3725
|
+
old_property_values: list[dict[str, Any]] = Field(
|
|
3726
|
+
description="Previous custom property values before the update"
|
|
3727
|
+
)
|
|
3728
|
+
|
|
3729
|
+
|
|
3730
|
+
class CustomPropertyValuesUpdated(CustomPropertyValuesBase):
|
|
3731
|
+
"""Payload for github.custom_property_values.updated events."""
|
|
3732
|
+
|
|
3733
|
+
_dispatch_topic: ClassVar[str] = "github.custom_property_values.updated"
|
|
3734
|
+
|
|
3735
|
+
|
|
3736
|
+
# =============================================================================
|
|
3737
|
+
# Deployment Protection Rule Event Payloads
|
|
3738
|
+
# =============================================================================
|
|
3739
|
+
|
|
3740
|
+
|
|
3741
|
+
class DeploymentProtectionRuleBase(GitHubEventPayload):
|
|
3742
|
+
"""Base class for deployment_protection_rule.* events.
|
|
3743
|
+
|
|
3744
|
+
Triggered when a deployment is waiting for a custom protection rule
|
|
3745
|
+
to be evaluated.
|
|
3746
|
+
"""
|
|
3747
|
+
|
|
3748
|
+
action: str = Field(description="Event action: requested")
|
|
3749
|
+
environment: str | None = Field(
|
|
3750
|
+
default=None, description="Target deployment environment"
|
|
3751
|
+
)
|
|
3752
|
+
event: str | None = Field(
|
|
3753
|
+
default=None, description="The event that triggered the protection rule"
|
|
3754
|
+
)
|
|
3755
|
+
deployment_callback_url: str | None = Field(
|
|
3756
|
+
default=None,
|
|
3757
|
+
description="URL to call back to when the protection rule is evaluated",
|
|
3758
|
+
)
|
|
3759
|
+
deployment: GitHubDeployment | None = Field(
|
|
3760
|
+
default=None, description="Deployment waiting for approval"
|
|
3761
|
+
)
|
|
3762
|
+
pull_requests: list[dict[str, Any]] = Field(
|
|
3763
|
+
default_factory=list, description="Pull requests associated with the deployment"
|
|
3764
|
+
)
|
|
3765
|
+
|
|
3766
|
+
|
|
3767
|
+
class DeploymentProtectionRuleRequested(DeploymentProtectionRuleBase):
|
|
3768
|
+
"""Payload for github.deployment_protection_rule.requested events."""
|
|
3769
|
+
|
|
3770
|
+
_dispatch_topic: ClassVar[str] = "github.deployment_protection_rule.requested"
|
|
3771
|
+
|
|
3772
|
+
|
|
3773
|
+
# =============================================================================
|
|
3774
|
+
# Installation Target Event Payloads
|
|
3775
|
+
# =============================================================================
|
|
3776
|
+
|
|
3777
|
+
|
|
3778
|
+
class InstallationTargetBase(GitHubEventPayload):
|
|
3779
|
+
"""Base class for installation_target.* events.
|
|
3780
|
+
|
|
3781
|
+
Triggered when a GitHub App owner's account or organization is renamed.
|
|
3782
|
+
"""
|
|
3783
|
+
|
|
3784
|
+
action: str = Field(description="Event action: renamed")
|
|
3785
|
+
target_type: str = Field(
|
|
3786
|
+
description="Type of the installation target: User or Organization"
|
|
3787
|
+
)
|
|
3788
|
+
account: dict[str, Any] = Field(
|
|
3789
|
+
description="Account (user or org) that was renamed"
|
|
3790
|
+
)
|
|
3791
|
+
changes: dict[str, Any] = Field(description="Changes made (e.g., old login value)")
|
|
3792
|
+
|
|
3793
|
+
|
|
3794
|
+
class InstallationTargetRenamed(InstallationTargetBase):
|
|
3795
|
+
"""Payload for github.installation_target.renamed events."""
|
|
3796
|
+
|
|
3797
|
+
_dispatch_topic: ClassVar[str] = "github.installation_target.renamed"
|
|
3798
|
+
installation: GitHubInstallation = Field(
|
|
3799
|
+
description="GitHub App installation associated with the renamed target"
|
|
3800
|
+
)
|
|
3801
|
+
|
|
3802
|
+
|
|
3803
|
+
# =============================================================================
|
|
3804
|
+
# Type alias for all GitHub event payloads
|
|
3805
|
+
# =============================================================================
|
|
3806
|
+
|
|
3807
|
+
GitHubPayload = (
|
|
3808
|
+
PullRequestBase
|
|
3809
|
+
| PullRequestReviewBase
|
|
3810
|
+
| PullRequestReviewCommentBase
|
|
3811
|
+
| PullRequestReviewThreadBase
|
|
3812
|
+
| IssueBase
|
|
3813
|
+
| IssueCommentBase
|
|
3814
|
+
| Push
|
|
3815
|
+
| CheckRunBase
|
|
3816
|
+
| CheckSuiteBase
|
|
3817
|
+
| WorkflowRunBase
|
|
3818
|
+
| WorkflowJobBase
|
|
3819
|
+
| ReleaseBase
|
|
3820
|
+
| Create
|
|
3821
|
+
| Delete
|
|
3822
|
+
| Fork
|
|
3823
|
+
| StarBase
|
|
3824
|
+
| InstallationBase
|
|
3825
|
+
| InstallationRepositoriesBase
|
|
3826
|
+
| DeploymentBase
|
|
3827
|
+
| DeploymentStatusBase
|
|
3828
|
+
| DeploymentReviewBase
|
|
3829
|
+
| CommitStatus
|
|
3830
|
+
| WorkflowDispatch
|
|
3831
|
+
| DependabotAlertBase
|
|
3832
|
+
| LabelBase
|
|
3833
|
+
| WatchBase
|
|
3834
|
+
| Public
|
|
3835
|
+
| Gollum
|
|
3836
|
+
| Ping
|
|
3837
|
+
| RepositoryImport
|
|
3838
|
+
| PageBuild
|
|
3839
|
+
| GitHubAppAuthorizationBase
|
|
3840
|
+
| TeamAdd
|
|
3841
|
+
| BranchProtectionConfigurationBase
|
|
3842
|
+
| BranchProtectionRuleBase
|
|
3843
|
+
| CommitCommentBase
|
|
3844
|
+
| DeployKeyBase
|
|
3845
|
+
| MemberBase
|
|
3846
|
+
| MembershipBase
|
|
3847
|
+
| MergeGroupBase
|
|
3848
|
+
| MetaBase
|
|
3849
|
+
| MilestoneEventBase
|
|
3850
|
+
| OrgBlockBase
|
|
3851
|
+
| RepositoryEventBase
|
|
3852
|
+
| RepositoryDispatch
|
|
3853
|
+
| DiscussionBase
|
|
3854
|
+
| DiscussionCommentBase
|
|
3855
|
+
| TeamBase
|
|
3856
|
+
| OrganizationBase
|
|
3857
|
+
| CodeScanningAlertBase
|
|
3858
|
+
| SecretScanningAlertBase
|
|
3859
|
+
| SecretScanningAlertLocationBase
|
|
3860
|
+
| RepositoryVulnerabilityAlertBase
|
|
3861
|
+
| SecurityAdvisoryBase
|
|
3862
|
+
| MarketplacePurchaseBase
|
|
3863
|
+
| PackageBase
|
|
3864
|
+
| RegistryPackageBase
|
|
3865
|
+
| ProjectBase
|
|
3866
|
+
| ProjectCardBase
|
|
3867
|
+
| ProjectColumnBase
|
|
3868
|
+
| ProjectsV2ItemBase
|
|
3869
|
+
| SponsorshipBase
|
|
3870
|
+
| CustomPropertyBase
|
|
3871
|
+
| CustomPropertyValuesBase
|
|
3872
|
+
| DeploymentProtectionRuleBase
|
|
3873
|
+
| InstallationTargetBase
|
|
3874
|
+
)
|
|
3875
|
+
|
|
3876
|
+
|
|
3877
|
+
# =============================================================================
|
|
3878
|
+
# Public API
|
|
3879
|
+
# =============================================================================
|
|
3880
|
+
|
|
3881
|
+
__all__ = [
|
|
3882
|
+
# Base event payload class
|
|
3883
|
+
"GitHubEventPayload",
|
|
3884
|
+
"GitHubPayload",
|
|
3885
|
+
# Pull Request events
|
|
3886
|
+
"PullRequestBase",
|
|
3887
|
+
"PullRequestOpened",
|
|
3888
|
+
"PullRequestClosed",
|
|
3889
|
+
"PullRequestReopened",
|
|
3890
|
+
"PullRequestSynchronize",
|
|
3891
|
+
"PullRequestEdited",
|
|
3892
|
+
"PullRequestLabeled",
|
|
3893
|
+
"PullRequestUnlabeled",
|
|
3894
|
+
"PullRequestAssigned",
|
|
3895
|
+
"PullRequestUnassigned",
|
|
3896
|
+
"PullRequestReviewRequested",
|
|
3897
|
+
"PullRequestReviewRequestRemoved",
|
|
3898
|
+
"PullRequestReadyForReview",
|
|
3899
|
+
"PullRequestConvertedToDraft",
|
|
3900
|
+
"PullRequestLocked",
|
|
3901
|
+
"PullRequestUnlocked",
|
|
3902
|
+
# Pull Request Review events
|
|
3903
|
+
"PullRequestReviewBase",
|
|
3904
|
+
"PullRequestReviewSubmitted",
|
|
3905
|
+
"PullRequestReviewEdited",
|
|
3906
|
+
"PullRequestReviewDismissed",
|
|
3907
|
+
# Pull Request Review Comment events
|
|
3908
|
+
"PullRequestReviewCommentBase",
|
|
3909
|
+
"PullRequestReviewCommentCreated",
|
|
3910
|
+
"PullRequestReviewCommentEdited",
|
|
3911
|
+
"PullRequestReviewCommentDeleted",
|
|
3912
|
+
# Pull Request Review Thread events
|
|
3913
|
+
"PullRequestReviewThreadBase",
|
|
3914
|
+
"PullRequestReviewThreadResolved",
|
|
3915
|
+
"PullRequestReviewThreadUnresolved",
|
|
3916
|
+
# Issue events
|
|
3917
|
+
"IssueBase",
|
|
3918
|
+
"IssueOpened",
|
|
3919
|
+
"IssueClosed",
|
|
3920
|
+
"IssueReopened",
|
|
3921
|
+
"IssueEdited",
|
|
3922
|
+
"IssueLabeled",
|
|
3923
|
+
"IssueUnlabeled",
|
|
3924
|
+
"IssueAssigned",
|
|
3925
|
+
"IssueUnassigned",
|
|
3926
|
+
"IssueMilestoned",
|
|
3927
|
+
"IssueDemilestoned",
|
|
3928
|
+
"IssueLocked",
|
|
3929
|
+
"IssueUnlocked",
|
|
3930
|
+
"IssueTransferred",
|
|
3931
|
+
"IssuePinned",
|
|
3932
|
+
"IssueUnpinned",
|
|
3933
|
+
# Issue Comment events
|
|
3934
|
+
"IssueCommentBase",
|
|
3935
|
+
"IssueCommentCreated",
|
|
3936
|
+
"IssueCommentEdited",
|
|
3937
|
+
"IssueCommentDeleted",
|
|
3938
|
+
# Push event (no action)
|
|
3939
|
+
"Push",
|
|
3940
|
+
# Check Run events
|
|
3941
|
+
"CheckRunBase",
|
|
3942
|
+
"CheckRunCreated",
|
|
3943
|
+
"CheckRunCompleted",
|
|
3944
|
+
"CheckRunRerequested",
|
|
3945
|
+
"CheckRunRequestedAction",
|
|
3946
|
+
# Check Suite events
|
|
3947
|
+
"CheckSuiteBase",
|
|
3948
|
+
"CheckSuiteCompleted",
|
|
3949
|
+
"CheckSuiteRequested",
|
|
3950
|
+
"CheckSuiteRerequested",
|
|
3951
|
+
# Workflow Run events
|
|
3952
|
+
"WorkflowRunBase",
|
|
3953
|
+
"WorkflowRunRequested",
|
|
3954
|
+
"WorkflowRunInProgress",
|
|
3955
|
+
"WorkflowRunCompleted",
|
|
3956
|
+
# Workflow Job events
|
|
3957
|
+
"WorkflowJobBase",
|
|
3958
|
+
"WorkflowJobQueued",
|
|
3959
|
+
"WorkflowJobInProgress",
|
|
3960
|
+
"WorkflowJobCompleted",
|
|
3961
|
+
"WorkflowJobWaiting",
|
|
3962
|
+
# Deployment events
|
|
3963
|
+
"GitHubDeployment",
|
|
3964
|
+
"DeploymentBase",
|
|
3965
|
+
"DeploymentCreated",
|
|
3966
|
+
# Deployment Status events
|
|
3967
|
+
"GitHubDeploymentStatus",
|
|
3968
|
+
"DeploymentStatusBase",
|
|
3969
|
+
"DeploymentStatusCreated",
|
|
3970
|
+
# Deployment Review events
|
|
3971
|
+
"DeploymentReviewBase",
|
|
3972
|
+
"DeploymentReviewApproved",
|
|
3973
|
+
"DeploymentReviewRejected",
|
|
3974
|
+
"DeploymentReviewRequested",
|
|
3975
|
+
# Commit Status events (no action)
|
|
3976
|
+
"GitHubStatusCommit",
|
|
3977
|
+
"CommitStatus",
|
|
3978
|
+
# WorkflowDispatch event (no action)
|
|
3979
|
+
"WorkflowDispatch",
|
|
3980
|
+
# Dependabot Alert events
|
|
3981
|
+
"GitHubDependabotDependency",
|
|
3982
|
+
"GitHubDependabotAdvisory",
|
|
3983
|
+
"GitHubDependabotVulnerability",
|
|
3984
|
+
"GitHubDependabotAlert",
|
|
3985
|
+
"DependabotAlertBase",
|
|
3986
|
+
"DependabotAlertCreated",
|
|
3987
|
+
"DependabotAlertFixed",
|
|
3988
|
+
"DependabotAlertDismissed",
|
|
3989
|
+
"DependabotAlertReintroduced",
|
|
3990
|
+
"DependabotAlertAutoDismissed",
|
|
3991
|
+
"DependabotAlertAutoReopened",
|
|
3992
|
+
"DependabotAlertReopened",
|
|
3993
|
+
# Label events
|
|
3994
|
+
"LabelBase",
|
|
3995
|
+
"LabelCreated",
|
|
3996
|
+
"LabelEdited",
|
|
3997
|
+
"LabelDeleted",
|
|
3998
|
+
# Release events
|
|
3999
|
+
"ReleaseBase",
|
|
4000
|
+
"ReleaseCreated",
|
|
4001
|
+
"ReleasePublished",
|
|
4002
|
+
"ReleaseUnpublished",
|
|
4003
|
+
"ReleaseEdited",
|
|
4004
|
+
"ReleaseDeleted",
|
|
4005
|
+
"ReleasePrereleased",
|
|
4006
|
+
"ReleaseReleased",
|
|
4007
|
+
# Repository events (no action)
|
|
4008
|
+
"Create",
|
|
4009
|
+
"Delete",
|
|
4010
|
+
"Fork",
|
|
4011
|
+
# Star events
|
|
4012
|
+
"StarBase",
|
|
4013
|
+
"StarCreated",
|
|
4014
|
+
"StarDeleted",
|
|
4015
|
+
# Installation events
|
|
4016
|
+
"InstallationBase",
|
|
4017
|
+
"InstallationCreated",
|
|
4018
|
+
"InstallationDeleted",
|
|
4019
|
+
"InstallationSuspend",
|
|
4020
|
+
"InstallationUnsuspend",
|
|
4021
|
+
"InstallationNewPermissionsAccepted",
|
|
4022
|
+
# Installation Repositories events
|
|
4023
|
+
"InstallationRepositoriesBase",
|
|
4024
|
+
"InstallationRepositoriesAdded",
|
|
4025
|
+
"InstallationRepositoriesRemoved",
|
|
4026
|
+
# Core GitHub types
|
|
4027
|
+
"GitHubModel",
|
|
4028
|
+
"GitHubUser",
|
|
4029
|
+
"GitHubRepository",
|
|
4030
|
+
"GitHubInstallation",
|
|
4031
|
+
"GitHubBranch",
|
|
4032
|
+
"GitHubPullRequest",
|
|
4033
|
+
"GitHubPullRequestLinks",
|
|
4034
|
+
"GitHubAutoMerge",
|
|
4035
|
+
"GitHubIssue",
|
|
4036
|
+
"GitHubComment",
|
|
4037
|
+
"GitHubReviewComment",
|
|
4038
|
+
"GitHubReview",
|
|
4039
|
+
"GitHubLabel",
|
|
4040
|
+
"GitHubMilestone",
|
|
4041
|
+
"GitHubLicense",
|
|
4042
|
+
"GitHubCommit",
|
|
4043
|
+
"GitHubCommitUser",
|
|
4044
|
+
"GitHubCheckRun",
|
|
4045
|
+
"GitHubCheckRunOutput",
|
|
4046
|
+
"GitHubCheckSuite",
|
|
4047
|
+
"GitHubWorkflowRun",
|
|
4048
|
+
"GitHubWorkflow",
|
|
4049
|
+
"GitHubWorkflowStep",
|
|
4050
|
+
"GitHubWorkflowJob",
|
|
4051
|
+
"GitHubRelease",
|
|
4052
|
+
"GitHubReleaseAsset",
|
|
4053
|
+
"GitHubRequestedAction",
|
|
4054
|
+
"GitHubReviewThread",
|
|
4055
|
+
"GitHubLink",
|
|
4056
|
+
"GitHubIssuePullRequest",
|
|
4057
|
+
"GitHubChangeValue",
|
|
4058
|
+
"GitHubChanges",
|
|
4059
|
+
# Watch events
|
|
4060
|
+
"WatchBase",
|
|
4061
|
+
"WatchStarted",
|
|
4062
|
+
# Single-action events (no action field)
|
|
4063
|
+
"Public",
|
|
4064
|
+
"Gollum",
|
|
4065
|
+
"Ping",
|
|
4066
|
+
"RepositoryImport",
|
|
4067
|
+
"PageBuild",
|
|
4068
|
+
"TeamAdd",
|
|
4069
|
+
# GitHub App Authorization events
|
|
4070
|
+
"GitHubAppAuthorizationBase",
|
|
4071
|
+
"GitHubAppAuthorizationRevoked",
|
|
4072
|
+
# Branch Protection Configuration events
|
|
4073
|
+
"BranchProtectionConfigurationBase",
|
|
4074
|
+
"BranchProtectionConfigurationEnabled",
|
|
4075
|
+
"BranchProtectionConfigurationDisabled",
|
|
4076
|
+
# Branch Protection Rule events
|
|
4077
|
+
"BranchProtectionRuleBase",
|
|
4078
|
+
"BranchProtectionRuleCreated",
|
|
4079
|
+
"BranchProtectionRuleDeleted",
|
|
4080
|
+
"BranchProtectionRuleEdited",
|
|
4081
|
+
# Commit Comment events
|
|
4082
|
+
"CommitCommentBase",
|
|
4083
|
+
"CommitCommentCreated",
|
|
4084
|
+
# Deploy Key events
|
|
4085
|
+
"DeployKeyBase",
|
|
4086
|
+
"DeployKeyCreated",
|
|
4087
|
+
"DeployKeyDeleted",
|
|
4088
|
+
# Member events
|
|
4089
|
+
"MemberBase",
|
|
4090
|
+
"MemberAdded",
|
|
4091
|
+
"MemberEdited",
|
|
4092
|
+
"MemberRemoved",
|
|
4093
|
+
# Membership events
|
|
4094
|
+
"MembershipBase",
|
|
4095
|
+
"MembershipAdded",
|
|
4096
|
+
"MembershipRemoved",
|
|
4097
|
+
# Merge Group events
|
|
4098
|
+
"MergeGroupBase",
|
|
4099
|
+
"MergeGroupChecksRequested",
|
|
4100
|
+
"MergeGroupDestroyed",
|
|
4101
|
+
# Meta events
|
|
4102
|
+
"MetaBase",
|
|
4103
|
+
"MetaDeleted",
|
|
4104
|
+
# Milestone events
|
|
4105
|
+
"MilestoneEventBase",
|
|
4106
|
+
"MilestoneClosed",
|
|
4107
|
+
"MilestoneCreated",
|
|
4108
|
+
"MilestoneDeleted",
|
|
4109
|
+
"MilestoneEdited",
|
|
4110
|
+
"MilestoneOpened",
|
|
4111
|
+
# Org Block events
|
|
4112
|
+
"OrgBlockBase",
|
|
4113
|
+
"OrgBlockBlocked",
|
|
4114
|
+
"OrgBlockUnblocked",
|
|
4115
|
+
# Repository events (with actions)
|
|
4116
|
+
"RepositoryEventBase",
|
|
4117
|
+
"RepositoryArchived",
|
|
4118
|
+
"RepositoryCreated",
|
|
4119
|
+
"RepositoryDeleted",
|
|
4120
|
+
"RepositoryEdited",
|
|
4121
|
+
"RepositoryPrivatized",
|
|
4122
|
+
"RepositoryPublicized",
|
|
4123
|
+
"RepositoryRenamed",
|
|
4124
|
+
"RepositoryTransferred",
|
|
4125
|
+
"RepositoryUnarchived",
|
|
4126
|
+
"RepositoryDispatch",
|
|
4127
|
+
# Issue additional actions
|
|
4128
|
+
"IssueDeleted",
|
|
4129
|
+
# Pull Request additional actions
|
|
4130
|
+
"PullRequestMilestoned",
|
|
4131
|
+
"PullRequestDemilestoned",
|
|
4132
|
+
"PullRequestAutoMergeEnabled",
|
|
4133
|
+
"PullRequestAutoMergeDisabled",
|
|
4134
|
+
"PullRequestEnqueued",
|
|
4135
|
+
"PullRequestDequeued",
|
|
4136
|
+
# Discussion events
|
|
4137
|
+
"GitHubDiscussion",
|
|
4138
|
+
"DiscussionBase",
|
|
4139
|
+
"DiscussionAnswered",
|
|
4140
|
+
"DiscussionCategoryChanged",
|
|
4141
|
+
"DiscussionCreated",
|
|
4142
|
+
"DiscussionDeleted",
|
|
4143
|
+
"DiscussionEdited",
|
|
4144
|
+
"DiscussionLabeled",
|
|
4145
|
+
"DiscussionLocked",
|
|
4146
|
+
"DiscussionPinned",
|
|
4147
|
+
"DiscussionTransferred",
|
|
4148
|
+
"DiscussionUnanswered",
|
|
4149
|
+
"DiscussionUnlabeled",
|
|
4150
|
+
"DiscussionUnlocked",
|
|
4151
|
+
"DiscussionUnpinned",
|
|
4152
|
+
# Discussion Comment events
|
|
4153
|
+
"DiscussionCommentBase",
|
|
4154
|
+
"DiscussionCommentCreated",
|
|
4155
|
+
"DiscussionCommentDeleted",
|
|
4156
|
+
"DiscussionCommentEdited",
|
|
4157
|
+
# Team events
|
|
4158
|
+
"GitHubTeam",
|
|
4159
|
+
"TeamBase",
|
|
4160
|
+
"TeamAddedToRepository",
|
|
4161
|
+
"TeamCreated",
|
|
4162
|
+
"TeamDeleted",
|
|
4163
|
+
"TeamEdited",
|
|
4164
|
+
"TeamRemovedFromRepository",
|
|
4165
|
+
# Organization events
|
|
4166
|
+
"OrganizationBase",
|
|
4167
|
+
"OrganizationDeleted",
|
|
4168
|
+
"OrganizationMemberAdded",
|
|
4169
|
+
"OrganizationMemberInvited",
|
|
4170
|
+
"OrganizationMemberRemoved",
|
|
4171
|
+
"OrganizationRenamed",
|
|
4172
|
+
# Code Scanning Alert events
|
|
4173
|
+
"GitHubCodeScanningAlert",
|
|
4174
|
+
"CodeScanningAlertBase",
|
|
4175
|
+
"CodeScanningAlertAppearedInBranch",
|
|
4176
|
+
"CodeScanningAlertClosedByUser",
|
|
4177
|
+
"CodeScanningAlertCreated",
|
|
4178
|
+
"CodeScanningAlertFixed",
|
|
4179
|
+
"CodeScanningAlertReopened",
|
|
4180
|
+
"CodeScanningAlertReopenedByUser",
|
|
4181
|
+
# Secret Scanning Alert events
|
|
4182
|
+
"GitHubSecretScanningAlert",
|
|
4183
|
+
"SecretScanningAlertBase",
|
|
4184
|
+
"SecretScanningAlertCreated",
|
|
4185
|
+
"SecretScanningAlertReopened",
|
|
4186
|
+
"SecretScanningAlertResolved",
|
|
4187
|
+
"SecretScanningAlertRevoked",
|
|
4188
|
+
# Secret Scanning Alert Location events
|
|
4189
|
+
"SecretScanningAlertLocationBase",
|
|
4190
|
+
"SecretScanningAlertLocationCreated",
|
|
4191
|
+
# Repository Vulnerability Alert events
|
|
4192
|
+
"RepositoryVulnerabilityAlertBase",
|
|
4193
|
+
"RepositoryVulnerabilityAlertCreate",
|
|
4194
|
+
"RepositoryVulnerabilityAlertDismiss",
|
|
4195
|
+
"RepositoryVulnerabilityAlertReopen",
|
|
4196
|
+
"RepositoryVulnerabilityAlertResolve",
|
|
4197
|
+
# Security Advisory events
|
|
4198
|
+
"SecurityAdvisoryBase",
|
|
4199
|
+
"SecurityAdvisoryPerformed",
|
|
4200
|
+
"SecurityAdvisoryPublished",
|
|
4201
|
+
"SecurityAdvisoryUpdated",
|
|
4202
|
+
"SecurityAdvisoryWithdrawn",
|
|
4203
|
+
# Marketplace Purchase events
|
|
4204
|
+
"MarketplacePurchaseBase",
|
|
4205
|
+
"MarketplacePurchaseCancelled",
|
|
4206
|
+
"MarketplacePurchaseChanged",
|
|
4207
|
+
"MarketplacePurchasePendingChange",
|
|
4208
|
+
"MarketplacePurchasePendingChangeCancelled",
|
|
4209
|
+
"MarketplacePurchasePurchased",
|
|
4210
|
+
# Package events
|
|
4211
|
+
"PackageBase",
|
|
4212
|
+
"PackagePublished",
|
|
4213
|
+
"PackageUpdated",
|
|
4214
|
+
# Registry Package events
|
|
4215
|
+
"RegistryPackageBase",
|
|
4216
|
+
"RegistryPackagePublished",
|
|
4217
|
+
"RegistryPackageUpdated",
|
|
4218
|
+
# Project events
|
|
4219
|
+
"ProjectBase",
|
|
4220
|
+
"ProjectClosed",
|
|
4221
|
+
"ProjectCreated",
|
|
4222
|
+
"ProjectDeleted",
|
|
4223
|
+
"ProjectEdited",
|
|
4224
|
+
"ProjectReopened",
|
|
4225
|
+
# Project Card events
|
|
4226
|
+
"ProjectCardBase",
|
|
4227
|
+
"ProjectCardConverted",
|
|
4228
|
+
"ProjectCardCreated",
|
|
4229
|
+
"ProjectCardDeleted",
|
|
4230
|
+
"ProjectCardEdited",
|
|
4231
|
+
"ProjectCardMoved",
|
|
4232
|
+
# Project Column events
|
|
4233
|
+
"ProjectColumnBase",
|
|
4234
|
+
"ProjectColumnCreated",
|
|
4235
|
+
"ProjectColumnDeleted",
|
|
4236
|
+
"ProjectColumnEdited",
|
|
4237
|
+
"ProjectColumnMoved",
|
|
4238
|
+
# Projects V2 Item events
|
|
4239
|
+
"ProjectsV2ItemBase",
|
|
4240
|
+
"ProjectsV2ItemArchived",
|
|
4241
|
+
"ProjectsV2ItemConverted",
|
|
4242
|
+
"ProjectsV2ItemCreated",
|
|
4243
|
+
"ProjectsV2ItemDeleted",
|
|
4244
|
+
"ProjectsV2ItemEdited",
|
|
4245
|
+
"ProjectsV2ItemReordered",
|
|
4246
|
+
"ProjectsV2ItemRestored",
|
|
4247
|
+
# Sponsorship events
|
|
4248
|
+
"SponsorshipBase",
|
|
4249
|
+
"SponsorshipCancelled",
|
|
4250
|
+
"SponsorshipCreated",
|
|
4251
|
+
"SponsorshipEdited",
|
|
4252
|
+
"SponsorshipPendingCancellation",
|
|
4253
|
+
"SponsorshipPendingTierChange",
|
|
4254
|
+
"SponsorshipTierChanged",
|
|
4255
|
+
# Custom Property events
|
|
4256
|
+
"CustomPropertyBase",
|
|
4257
|
+
"CustomPropertyCreated",
|
|
4258
|
+
"CustomPropertyDeleted",
|
|
4259
|
+
# Custom Property Values events
|
|
4260
|
+
"CustomPropertyValuesBase",
|
|
4261
|
+
"CustomPropertyValuesUpdated",
|
|
4262
|
+
# Deployment Protection Rule events
|
|
4263
|
+
"DeploymentProtectionRuleBase",
|
|
4264
|
+
"DeploymentProtectionRuleRequested",
|
|
4265
|
+
# Installation Target events
|
|
4266
|
+
"InstallationTargetBase",
|
|
4267
|
+
"InstallationTargetRenamed",
|
|
4268
|
+
]
|