Skip to content

Commit 8d47c72

Browse files
authored
Merge pull request #758 from XiongKezhi/add-check-suite-warp-up
Add wrapUp() for GHEventPayload.CheckSuite
2 parents 2aef356 + a7fda3e commit 8d47c72

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/main/java/org/kohsuke/github/GHEventPayload.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void wrapUp(GitHub root) {
4848
}
4949

5050
// List of events that still need to be added:
51-
// CheckRunEvent CheckSuiteEvent ContentReferenceEvent
51+
// ContentReferenceEvent
5252
// DeployKeyEvent DownloadEvent FollowEvent ForkApplyEvent GitHubAppAuthorizationEvent GistEvent GollumEvent
5353
// InstallationEvent InstallationRepositoriesEvent IssuesEvent LabelEvent MarketplacePurchaseEvent MemberEvent
5454
// MembershipEvent MetaEvent MilestoneEvent OrganizationEvent OrgBlockEvent PackageEvent PageBuildEvent
@@ -191,6 +191,20 @@ public GHRepository getRepository() {
191191
repository.root = root;
192192
return repository;
193193
}
194+
195+
@Override
196+
void wrapUp(GitHub root) {
197+
super.wrapUp(root);
198+
if (checkSuite == null)
199+
throw new IllegalStateException(
200+
"Expected check_suite payload, but got something else. Maybe we've got another type of event?");
201+
if (repository != null) {
202+
repository.wrap(root);
203+
checkSuite.wrap(repository);
204+
} else {
205+
checkSuite.wrap(root);
206+
}
207+
}
194208
}
195209

196210
/**

0 commit comments

Comments
 (0)