private function checkOwner(InputInterface $input, array $pr)
{
// Don't check when non-interactive or when pull-request is on target org already
if (!$input->isInteractive() || $pr['head']['user'] === $input->getOption('org')) {
return;
}
if ($pr['head']['user'] === $this->getParameter($input, 'authentication')['username']) {
return;
}
$this->getHelper('gush_style')->note(['You are not the owner of the repository pull-requests\'s source-branch.', sprintf('Make sure you have push access to the "%s/%s" repository before you continue.', $pr['head']['user'], $pr['head']['repo'])]);
if (!$this->getHelper('gush_style')->confirm('Do you want to squash the pull-request and push?')) {
throw new UserException('User aborted.');
}
}