/** * Does this repository match the repository referenced in the given {@link GHCommitPointer}? */ public boolean matches(GHCommitPointer commit) { final GHUser user; try { user = commit.getUser(); } catch (IOException ex) { LOGGER.debug("Failed to extract user from commit " + commit, ex); return false; } return userName.equals(user.getLogin()) && repositoryName.equals(commit.getRepository().getName()) && host.equals(commit.getRepository().getHtmlUrl().getHost()); }
private GHPullRequest getPullRequestWithPullReqIdentifier(GHRepository parent) throws IOException { List<GHPullRequest> pullRequests; GHUser myself; try { pullRequests = parent.getPullRequests(GHIssueState.OPEN); myself = gitHubUtil.getMyself(); } catch (IOException e) { log.warn("Error occurred while retrieving pull requests for {}", parent.getFullName()); return null; } for (GHPullRequest pullRequest : pullRequests) { GHUser user = pullRequest.getHead().getUser(); if (myself.equals(user) && pullRequest.getBody().equals(Constants.PULL_REQ_ID)) { return pullRequest; } } return null; } }
private GHPullRequest getPullRequestWithPullReqIdentifier(GHRepository parent) throws IOException { List<GHPullRequest> pullRequests; GHUser myself; try { pullRequests = parent.getPullRequests(GHIssueState.OPEN); myself = gitHubUtil.getMyself(); } catch (IOException e) { log.warn("Error occurred while retrieving pull requests for {}", parent.getFullName()); return null; } for (GHPullRequest pullRequest : pullRequests) { GHUser user = pullRequest.getHead().getUser(); if (myself.equals(user) && pullRequest.getBody().equals(Constants.PULL_REQ_ID)) { return pullRequest; } } return null; } }
PRs: for (final GHPullRequest pr : request.getPullRequests()) { int number = pr.getNumber(); boolean fork = !ghRepository.getOwner().equals(pr.getHead().getUser()); listener.getLogger().format("%n Checking pull request %s%n", HyperlinkNote.encodeTo(pr.getHtmlUrl().toString(), "#" + number));
String prOwnerName = ghPullRequest.getHead().getUser().getLogin(); if (!prOwnerName.matches(GitHubSCMSource.VALID_GITHUB_USER_NAME)) {