public static Repository getRepository(final GitHubEvent event) {
        if (event == null || event.payload() == null) {
            return null;
        }

        GitHubEventType type = event.type();
        if (ForkEvent.equals(type)) {
            Repository repository = ((ForkPayload)event.payload()).forkee();
            // Verify repository has valid name and owner
            if (repository != null && !TextUtils.isEmpty(repository.name())
                    && repository.owner() != null
                    && !TextUtils.isEmpty(repository.owner().login())) {
                return repository;
            }
        }

        if (CreateEvent.equals(type) || WatchEvent.equals(type)
                || PublicEvent.equals(type)) {
            return ConvertUtils.eventRepoToRepo(event.repo());
        }

        return null;
    }
Get {@link Repository} from event

@param event
@return gist or null if event doesn't apply
app/src/main/java/com/github/pockethub/android/core/repo/RepositoryEventMatcher.java