private List<RepositoryContents> getRepositoryContents(final Repository repository, final Release release) throws IOException {
        logger.log(Level.INFO, "Getting contents for {0}.", repository.getName());

        ContentsService contentsService = new ContentsService(connectToGitHub());
        if (release == null) {
            // We didn't find a release for this repo. Just return the HEAD contents.
            return contentsService.getContents(repository);
        }
        else {
            return contentsService.getContents(repository, null, release.getTagName());
        }
    }