Skip to content

Commit 9a00f9b

Browse files
authored
⬆️ upgrade to webhooks v7
1 parent 1a09934 commit 9a00f9b

File tree

3 files changed

+244
-116
lines changed

3 files changed

+244
-116
lines changed

nonebot/adapters/github/event.py

Lines changed: 134 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
from githubkit.webhooks.models import PullRequestEdited as PullRequestEditedPayload
8181
from githubkit.webhooks.models import PullRequestLocked as PullRequestLockedPayload
8282
from githubkit.webhooks.models import PullRequestOpened as PullRequestOpenedPayload
83-
from githubkit.webhooks.models import PullRequestQueued as PullRequestQueuedPayload
8483
from githubkit.webhooks.models import RepositoryCreated as RepositoryCreatedPayload
8584
from githubkit.webhooks.models import RepositoryDeleted as RepositoryDeletedPayload
8685
from githubkit.webhooks.models import RepositoryRenamed as RepositoryRenamedPayload
@@ -99,6 +98,7 @@
9998
from githubkit.webhooks.models import ReleaseUnpublished as ReleaseUnpublishedPayload
10099
from githubkit.webhooks.models import RepositoryArchived as RepositoryArchivedPayload
101100
from githubkit.webhooks.models import SponsorshipCreated as SponsorshipCreatedPayload
101+
from githubkit.webhooks.models import WorkflowJobWaiting as WorkflowJobWaitingPayload
102102
from githubkit.webhooks.models import CheckRunRerequested as CheckRunRerequestedPayload
103103
from githubkit.webhooks.models import CheckSuiteCompleted as CheckSuiteCompletedPayload
104104
from githubkit.webhooks.models import CheckSuiteRequested as CheckSuiteRequestedPayload
@@ -113,11 +113,15 @@
113113
from githubkit.webhooks.models import ProjectColumnEdited as ProjectColumnEditedPayload
114114
from githubkit.webhooks.models import PullRequestAssigned as PullRequestAssignedPayload
115115
from githubkit.webhooks.models import PullRequestDequeued as PullRequestDequeuedPayload
116+
from githubkit.webhooks.models import PullRequestEnqueued as PullRequestEnqueuedPayload
116117
from githubkit.webhooks.models import PullRequestReopened as PullRequestReopenedPayload
117118
from githubkit.webhooks.models import PullRequestUnlocked as PullRequestUnlockedPayload
118119
from githubkit.webhooks.models import (
119120
CommitCommentCreated as CommitCommentCreatedPayload,
120121
)
122+
from githubkit.webhooks.models import (
123+
DependabotAlertFixed as DependabotAlertFixedPayload,
124+
)
121125
from githubkit.webhooks.models import (
122126
DiscussionUnanswered as DiscussionUnansweredPayload,
123127
)
@@ -172,6 +176,9 @@
172176
from githubkit.webhooks.models import (
173177
ProjectsV2ItemDeleted as ProjectsV2ItemDeletedPayload,
174178
)
179+
from githubkit.webhooks.models import (
180+
PullRequestMilestoned as PullRequestMilestonedPayload,
181+
)
175182
from githubkit.webhooks.models import (
176183
PullRequestUnassigned as PullRequestUnassignedPayload,
177184
)
@@ -190,9 +197,15 @@
190197
from githubkit.webhooks.models import (
191198
WorkflowJobInProgress as WorkflowJobInProgressPayload,
192199
)
200+
from githubkit.webhooks.models import (
201+
WorkflowRunInProgress as WorkflowRunInProgressPayload,
202+
)
193203
from githubkit.webhooks.models import (
194204
CodeScanningAlertFixed as CodeScanningAlertFixedPayload,
195205
)
206+
from githubkit.webhooks.models import (
207+
DependabotAlertCreated as DependabotAlertCreatedPayload,
208+
)
196209
from githubkit.webhooks.models import (
197210
ProjectsV2ItemArchived as ProjectsV2ItemArchivedPayload,
198211
)
@@ -202,12 +215,18 @@
202215
from githubkit.webhooks.models import (
203216
PullRequestSynchronize as PullRequestSynchronizePayload,
204217
)
218+
from githubkit.webhooks.models import (
219+
RegistryPackageUpdated as RegistryPackageUpdatedPayload,
220+
)
205221
from githubkit.webhooks.models import (
206222
SponsorshipTierChanged as SponsorshipTierChangedPayload,
207223
)
208224
from githubkit.webhooks.models import (
209225
CheckRunRequestedAction as CheckRunRequestedActionPayload,
210226
)
227+
from githubkit.webhooks.models import (
228+
DependabotAlertReopened as DependabotAlertReopenedPayload,
229+
)
211230
from githubkit.webhooks.models import (
212231
DeploymentStatusCreated as DeploymentStatusCreatedPayload,
213232
)
@@ -223,6 +242,9 @@
223242
from githubkit.webhooks.models import (
224243
ProjectsV2ItemReordered as ProjectsV2ItemReorderedPayload,
225244
)
245+
from githubkit.webhooks.models import (
246+
PullRequestDemilestoned as PullRequestDemilestonedPayload,
247+
)
226248
from githubkit.webhooks.models import (
227249
PullRequestReviewEdited as PullRequestReviewEditedPayload,
228250
)
@@ -235,18 +257,27 @@
235257
from githubkit.webhooks.models import (
236258
CodeScanningAlertCreated as CodeScanningAlertCreatedPayload,
237259
)
260+
from githubkit.webhooks.models import (
261+
DependabotAlertDismissed as DependabotAlertDismissedPayload,
262+
)
238263
from githubkit.webhooks.models import (
239264
DiscussionCommentCreated as DiscussionCommentCreatedPayload,
240265
)
241266
from githubkit.webhooks.models import (
242267
DiscussionCommentDeleted as DiscussionCommentDeletedPayload,
243268
)
269+
from githubkit.webhooks.models import (
270+
RegistryPackagePublished as RegistryPackagePublishedPayload,
271+
)
244272
from githubkit.webhooks.models import (
245273
CodeScanningAlertReopened as CodeScanningAlertReopenedPayload,
246274
)
247275
from githubkit.webhooks.models import (
248276
DiscussionCategoryChanged as DiscussionCategoryChangedPayload,
249277
)
278+
from githubkit.webhooks.models import (
279+
InstallationTargetRenamed as InstallationTargetRenamedPayload,
280+
)
250281
from githubkit.webhooks.models import (
251282
MergeGroupChecksRequested as MergeGroupChecksRequestedPayload,
252283
)
@@ -286,12 +317,18 @@
286317
from githubkit.webhooks.models import (
287318
SecretScanningAlertCreated as SecretScanningAlertCreatedPayload,
288319
)
320+
from githubkit.webhooks.models import (
321+
SecretScanningAlertRevoked as SecretScanningAlertRevokedPayload,
322+
)
289323
from githubkit.webhooks.models import (
290324
BranchProtectionRuleCreated as BranchProtectionRuleCreatedPayload,
291325
)
292326
from githubkit.webhooks.models import (
293327
BranchProtectionRuleDeleted as BranchProtectionRuleDeletedPayload,
294328
)
329+
from githubkit.webhooks.models import (
330+
DependabotAlertReintroduced as DependabotAlertReintroducedPayload,
331+
)
295332
from githubkit.webhooks.models import (
296333
PullRequestAutoMergeEnabled as PullRequestAutoMergeEnabledPayload,
297334
)
@@ -356,6 +393,9 @@
356393
from githubkit.webhooks.models import (
357394
CodeScanningAlertAppearedInBranch as CodeScanningAlertAppearedInBranchPayload,
358395
)
396+
from githubkit.webhooks.models import (
397+
DeploymentProtectionRuleRequested as DeploymentProtectionRuleRequestedPayload,
398+
)
359399
from githubkit.webhooks.models import (
360400
PullRequestReviewThreadUnresolved as PullRequestReviewThreadUnresolvedPayload,
361401
)
@@ -368,6 +408,9 @@
368408
from githubkit.webhooks.models import (
369409
RepositoryVulnerabilityAlertReopen as RepositoryVulnerabilityAlertReopenPayload,
370410
)
411+
from githubkit.webhooks.models import (
412+
SecretScanningAlertLocationCreated as SecretScanningAlertLocationCreatedPayload,
413+
)
371414
from githubkit.webhooks.models import (
372415
PullRequestReviewRequestRemovedOneof0,
373416
PullRequestReviewRequestRemovedOneof1,
@@ -577,6 +620,26 @@ class Config:
577620
keep_untouched = (cached_property,)
578621

579622

623+
class DependabotAlertCreated(Event):
624+
payload: DependabotAlertCreatedPayload
625+
626+
627+
class DependabotAlertDismissed(Event):
628+
payload: DependabotAlertDismissedPayload
629+
630+
631+
class DependabotAlertFixed(Event):
632+
payload: DependabotAlertFixedPayload
633+
634+
635+
class DependabotAlertReintroduced(Event):
636+
payload: DependabotAlertReintroducedPayload
637+
638+
639+
class DependabotAlertReopened(Event):
640+
payload: DependabotAlertReopenedPayload
641+
642+
580643
class DeployKeyCreated(Event):
581644
payload: DeployKeyCreatedPayload
582645

@@ -589,6 +652,10 @@ class DeploymentCreated(Event):
589652
payload: DeploymentCreatedPayload
590653

591654

655+
class DeploymentProtectionRuleRequested(Event):
656+
payload: DeploymentProtectionRuleRequestedPayload
657+
658+
592659
class DeploymentStatusCreated(Event):
593660
payload: DeploymentStatusCreatedPayload
594661

@@ -689,6 +756,10 @@ class InstallationRepositoriesRemoved(Event):
689756
payload: InstallationRepositoriesRemovedPayload
690757

691758

759+
class InstallationTargetRenamed(Event):
760+
payload: InstallationTargetRenamedPayload
761+
762+
692763
class IssueCommentCreated(Event):
693764
payload: IssueCommentCreatedPayload
694765

@@ -1022,6 +1093,10 @@ class PullRequestConvertedToDraft(Event):
10221093
payload: PullRequestConvertedToDraftPayload
10231094

10241095

1096+
class PullRequestDemilestoned(Event):
1097+
payload: PullRequestDemilestonedPayload
1098+
1099+
10251100
class PullRequestDequeued(Event):
10261101
payload: PullRequestDequeuedPayload
10271102

@@ -1030,6 +1105,10 @@ class PullRequestEdited(Event):
10301105
payload: PullRequestEditedPayload
10311106

10321107

1108+
class PullRequestEnqueued(Event):
1109+
payload: PullRequestEnqueuedPayload
1110+
1111+
10331112
class PullRequestLabeled(Event):
10341113
payload: PullRequestLabeledPayload
10351114

@@ -1038,12 +1117,12 @@ class PullRequestLocked(Event):
10381117
payload: PullRequestLockedPayload
10391118

10401119

1041-
class PullRequestOpened(Event):
1042-
payload: PullRequestOpenedPayload
1120+
class PullRequestMilestoned(Event):
1121+
payload: PullRequestMilestonedPayload
10431122

10441123

1045-
class PullRequestQueued(Event):
1046-
payload: PullRequestQueuedPayload
1124+
class PullRequestOpened(Event):
1125+
payload: PullRequestOpenedPayload
10471126

10481127

10491128
class PullRequestReadyForReview(Event):
@@ -1149,6 +1228,14 @@ class PullRequestReviewThreadUnresolved(Event):
11491228
payload: PullRequestReviewThreadUnresolvedPayload
11501229

11511230

1231+
class RegistryPackagePublished(Event):
1232+
payload: RegistryPackagePublishedPayload
1233+
1234+
1235+
class RegistryPackageUpdated(Event):
1236+
payload: RegistryPackageUpdatedPayload
1237+
1238+
11521239
class ReleaseCreated(Event):
11531240
payload: ReleaseCreatedPayload
11541241

@@ -1241,6 +1328,14 @@ class SecretScanningAlertResolved(Event):
12411328
payload: SecretScanningAlertResolvedPayload
12421329

12431330

1331+
class SecretScanningAlertRevoked(Event):
1332+
payload: SecretScanningAlertRevokedPayload
1333+
1334+
1335+
class SecretScanningAlertLocationCreated(Event):
1336+
payload: SecretScanningAlertLocationCreatedPayload
1337+
1338+
12441339
class SecurityAdvisoryPerformed(Event):
12451340
payload: SecurityAdvisoryPerformedPayload
12461341

@@ -1325,10 +1420,18 @@ class WorkflowJobQueued(Event):
13251420
payload: WorkflowJobQueuedPayload
13261421

13271422

1423+
class WorkflowJobWaiting(Event):
1424+
payload: WorkflowJobWaitingPayload
1425+
1426+
13281427
class WorkflowRunCompleted(Event):
13291428
payload: WorkflowRunCompletedPayload
13301429

13311430

1431+
class WorkflowRunInProgress(Event):
1432+
payload: WorkflowRunInProgressPayload
1433+
1434+
13321435
class WorkflowRunRequested(Event):
13331436
payload: WorkflowRunRequestedPayload
13341437

@@ -1374,13 +1477,23 @@ class WorkflowRunRequested(Event):
13741477
"commit_comment": {
13751478
"created": CommitCommentCreated,
13761479
},
1480+
"dependabot_alert": {
1481+
"created": DependabotAlertCreated,
1482+
"dismissed": DependabotAlertDismissed,
1483+
"fixed": DependabotAlertFixed,
1484+
"reintroduced": DependabotAlertReintroduced,
1485+
"reopened": DependabotAlertReopened,
1486+
},
13771487
"deploy_key": {
13781488
"created": DeployKeyCreated,
13791489
"deleted": DeployKeyDeleted,
13801490
},
13811491
"deployment": {
13821492
"created": DeploymentCreated,
13831493
},
1494+
"deployment_protection_rule": {
1495+
"requested": DeploymentProtectionRuleRequested,
1496+
},
13841497
"deployment_status": {
13851498
"created": DeploymentStatusCreated,
13861499
},
@@ -1418,6 +1531,9 @@ class WorkflowRunRequested(Event):
14181531
"added": InstallationRepositoriesAdded,
14191532
"removed": InstallationRepositoriesRemoved,
14201533
},
1534+
"installation_target": {
1535+
"renamed": InstallationTargetRenamed,
1536+
},
14211537
"issue_comment": {
14221538
"created": IssueCommentCreated,
14231539
"deleted": IssueCommentDeleted,
@@ -1525,12 +1641,14 @@ class WorkflowRunRequested(Event):
15251641
"auto_merge_enabled": PullRequestAutoMergeEnabled,
15261642
"closed": PullRequestClosed,
15271643
"converted_to_draft": PullRequestConvertedToDraft,
1644+
"demilestoned": PullRequestDemilestoned,
15281645
"dequeued": PullRequestDequeued,
15291646
"edited": PullRequestEdited,
1647+
"enqueued": PullRequestEnqueued,
15301648
"labeled": PullRequestLabeled,
15311649
"locked": PullRequestLocked,
1650+
"milestoned": PullRequestMilestoned,
15321651
"opened": PullRequestOpened,
1533-
"queued": PullRequestQueued,
15341652
"ready_for_review": PullRequestReadyForReview,
15351653
"reopened": PullRequestReopened,
15361654
"review_request_removed": PullRequestReviewRequestRemoved,
@@ -1554,6 +1672,10 @@ class WorkflowRunRequested(Event):
15541672
"resolved": PullRequestReviewThreadResolved,
15551673
"unresolved": PullRequestReviewThreadUnresolved,
15561674
},
1675+
"registry_package": {
1676+
"published": RegistryPackagePublished,
1677+
"updated": RegistryPackageUpdated,
1678+
},
15571679
"release": {
15581680
"created": ReleaseCreated,
15591681
"deleted": ReleaseDeleted,
@@ -1584,6 +1706,10 @@ class WorkflowRunRequested(Event):
15841706
"created": SecretScanningAlertCreated,
15851707
"reopened": SecretScanningAlertReopened,
15861708
"resolved": SecretScanningAlertResolved,
1709+
"revoked": SecretScanningAlertRevoked,
1710+
},
1711+
"secret_scanning_alert_location": {
1712+
"created": SecretScanningAlertLocationCreated,
15871713
},
15881714
"security_advisory": {
15891715
"performed": SecurityAdvisoryPerformed,
@@ -1617,9 +1743,11 @@ class WorkflowRunRequested(Event):
16171743
"completed": WorkflowJobCompleted,
16181744
"in_progress": WorkflowJobInProgress,
16191745
"queued": WorkflowJobQueued,
1746+
"waiting": WorkflowJobWaiting,
16201747
},
16211748
"workflow_run": {
16221749
"completed": WorkflowRunCompleted,
1750+
"in_progress": WorkflowRunInProgress,
16231751
"requested": WorkflowRunRequested,
16241752
},
16251753
}

0 commit comments

Comments
 (0)