private function addCommentsToMergeCommit(array $comments, $sha, $remote)
{
if (0 === count($comments)) {
return;
}
$commentText = '';
foreach ($comments as $comment) {
$commentText .= $this->render('comment', ['login' => $comment['user'], 'created_at' => $comment['created_at']->format('Y-m-d H:i'), 'body' => $comment['body']]);
}
/** @var GitHelper $gitHelper */
$gitHelper = $this->getHelper('git');
$gitHelper->remoteUpdate($remote);
$gitHelper->addNotes($commentText, $sha, 'github-comments');
$gitHelper->pushToRemote($remote, 'refs/notes/github-comments');
}