private Repository getRepositoryFork(GitHubClient gitHubClient, Repository masterRepository) throws IOException {
        Properties properties = ApplicationProperties.getProperties();
        RepositoryService repositoryService = new RepositoryService(gitHubClient);
        
        List<SearchRepository> searchRepositories = repositoryService.searchRepositories(
                masterRepository.getName()
                + " user:" + properties.getProperty(PropertiesConstants.GITHUB_ANON_USERNAME) 
                + " fork:only");
        
        if (searchRepositories.isEmpty()) {
            logger.log(Level.INFO, "No anon fork of {0} found. Forking.", masterRepository.getName());
            return forkAndWait(gitHubClient, masterRepository);
        }
        
        Release latestRelease = getLatestRelease(masterRepository);
        Repository repositoryFork = repositoryService.getRepository(
                properties.getProperty(PropertiesConstants.GITHUB_ANON_USERNAME), 
                masterRepository.getName());
        
        if (latestRelease.getPublishedAt().after(repositoryFork.getCreatedAt())) {
            // There's been a release on the master since we last forked, so delete and re-create
            logger.log(Level.INFO, "New release found since anon fork of {0} was created. Deleting and re-forking.", masterRepository.getName());
            deleteAndWait(gitHubClient, repositoryFork);
            return forkAndWait(gitHubClient, masterRepository);
        }
        else {
            return repositoryFork;
        }
    }