Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,22 @@ protected void onEvent(final GHSubscriberEvent event) {
URL repoUrl = push.getRepository().getUrl();
final String pusherName = push.getPusher().getName();
LOGGER.info("Received PushEvent for {} from {}", repoUrl, event.getOrigin());
final GitHubRepositoryName changedRepository = GitHubRepositoryName.create(repoUrl.toExternalForm());
GitHubRepositoryName fromEventRepository = GitHubRepositoryName.create(repoUrl.toExternalForm());

if (fromEventRepository == null) {
// On push event on github.com url === html_url
// this is not consistent with the API docs and with hosted repositories
// see https://goo.gl/c1qmY7
// let's retry with 'html_url'
URL htmlUrl = push.getRepository().getHtmlUrl();
fromEventRepository = GitHubRepositoryName.create(htmlUrl.toExternalForm());
if (fromEventRepository != null) {
LOGGER.debug("PushEvent handling: 'html_url' field "
+ "has been used to retrieve project information (instead of default 'url' field)");
}
}

final GitHubRepositoryName changedRepository = fromEventRepository;

if (changedRepository != null) {
// run in high privilege to see all the projects anonymous users don't see.
Expand Down