Skip to content

Commit

Permalink
Merge pull request #758 from XiongKezhi/add-check-suite-warp-up
Browse files Browse the repository at this point in the history
Add wrapUp() for GHEventPayload.CheckSuite
  • Loading branch information
bitwiseman committed Mar 30, 2020
2 parents 2aef356 + a7fda3e commit 8d47c72
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/org/kohsuke/github/GHEventPayload.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void wrapUp(GitHub root) {
}

// List of events that still need to be added:
// CheckRunEvent CheckSuiteEvent ContentReferenceEvent
// ContentReferenceEvent
// DeployKeyEvent DownloadEvent FollowEvent ForkApplyEvent GitHubAppAuthorizationEvent GistEvent GollumEvent
// InstallationEvent InstallationRepositoriesEvent IssuesEvent LabelEvent MarketplacePurchaseEvent MemberEvent
// MembershipEvent MetaEvent MilestoneEvent OrganizationEvent OrgBlockEvent PackageEvent PageBuildEvent
Expand Down Expand Up @@ -191,6 +191,20 @@ public GHRepository getRepository() {
repository.root = root;
return repository;
}

@Override
void wrapUp(GitHub root) {
super.wrapUp(root);
if (checkSuite == null)
throw new IllegalStateException(
"Expected check_suite payload, but got something else. Maybe we've got another type of event?");
if (repository != null) {
repository.wrap(root);
checkSuite.wrap(repository);
} else {
checkSuite.wrap(root);
}
}
}

/**
Expand Down

0 comments on commit 8d47c72

Please sign in to comment.