Create a commit comment

@return GitHubCommitComment
167491
public function createCommitComment($owner, $repo, $sha, $body, $path = null, $position = null)
	{
		$data = array(
			'body' => $body,
		);
		if (!is_null($path))
			$data['path'] = $path;
		if (!is_null($position))
			$data['position'] = $position;

		return $this->client->request("/repos/$owner/$repo/commits/$sha/comments", 'POST', json_encode($data), 201, 'GitHubCommitComment');
	}
870810
public function setComment(\Haven\CmsBundle\Entity\Comment $comment = null)
    {
        $this->comment = $comment;

        return $this;
    }
1184954
public function comments(string $commit)
    {
        return new Comments($this->getHttpClient(), $this->username, $this->repo, $commit);
    }
1361588
function commit() {
		$this->savepoint--;

		if ($this->savepoint == 0) {
			$this->dbh->commit();
		}
		else { // not finished with transaction yet
			$this->dbh->exec('RELEASE SAVEPOINT save'.$this->savepoint);
		}

		return $this;
	}
305080
function attachCommentReply(comment) {
    return function reply(body, callback) {
        github.replyToReviewComment(this.repo.data.owner.login, this.repo.data.name, this.data.number, comment.id, body, callback);
    }.bind(this);
}
1279462
public function addComment($comment)
    {
        $comment->setPaymentId($this->getPaymentId());
        $comment->save();

        $this->load($this->getPaymentId());

        return $comment;
    }
416166
def add_comment(repo: GithubRepository, pull_id: int, text: str) -> None:
    
    url = ("https://api.github.com/repos/{}/{}/issues/{}/comments"
           "?access_token={}".format(repo.organization,
                                     repo.name,
                                     pull_id,
                                     repo.access_token))
    data = {
        'body': text
    }
    response = requests.post(url, json=data)

    if response.status_code != 201:
        raise RuntimeError('Add comment failed. Code: {}. Content: {}.'.format(
            response.status_code, response.content))
1188776
public function addComment($comment)
    {
        if(Yii::$app->params['commentNeedApproval'])
            $comment->status = Comment::STATUS_PENDING;
        else
            $comment->status = Comment::STATUS_APPROVED;
        // set model and parent_id (parent model ID)
        $comment->model = self::COMMENT_FOR;
        $comment->parent_id = $this->id;
        $comment->user_id = \Yii::$app->user->id;
        if($comment->thread == '-')
            // set new thread
            $comment->thread = time() . uniqid();
        else
            // unmark previous comment
            Yii::$app->db->createCommand("UPDATE {{%comment}} SET last=0 WHERE thread='{$comment->thread}' AND last=1")->execute();
        // mark only last comment in a thread
        $comment->last = 1;
        if($comment->save()) {
            if(Yii::$app->params['notifyResponsibleAboutComment'])
                $comment->trigger(Comment::EVENT_JUST_ADDED);
            $comment->content = '';
            return true;
        } else
            return false;
    }
1350083
public function CommentsForm()
    {
        $form = Injector::inst()->create(CommentForm::class, __FUNCTION__, $this);

        // hook to allow further extensions to alter the comments form
        $this->extend('alterCommentForm', $form);

        return $form;
    }
64142
public function addComment($comment)
    {
        if (is_string($comment)) {
            $comment = AnHelperString::trim($comment);

            $comment = array(
                'author' => get_viewer() ,
                'body' => $comment,
                'component' => $this->component,
            );
        }

        $comment = $this->_mixer->comments->addNew($comment);

        if ($this->_mixer->isSubscribable() && !$this->_mixer->subscribed($comment->author)) {
            $this->_mixer->addSubscriber($comment->author);
        }

        return $comment;
    }
824694
public function addCommentAbove($comment) {
    if ($comment instanceof LineCommentBlockNode) {
      $this->before($comment);
    }
    elseif (is_string($comment)) {
      $this->addCommentAbove(LineCommentBlockNode::create($comment));
    }
    else {
      throw new \InvalidArgumentException();
    }
    return $this;
  }
384642
def post_comment(self, message):
        
        report_url = (
            'https://api.github.com/repos/%s/issues/%s/comments'
            % (self.repo_name, self.pr_number)
        )
        result = self.requester.post(report_url, {'body': message})
        if result.status_code >= 400:
            log.error("Error posting comment to github. %s", result.json())
        return result
381917
public function writeComment(string $comment): XmlStreamWriter
    {
        return $this->append(
                function(\DOMNode $parent) use ($comment)
                {
                    $parent->appendChild(
                            $this->doc->createComment($this->encode($comment))
                    );
                },
                'comment'
        );
    }
1169836
public function setComment(\Innova\CollecticielBundle\Entity\Comment $comment)
    {
        $this->comment = $comment;

        return $this;
    }
1153400
public function setComment($comment): self
    {
        if (!empty($comment)) {
            if (is_array($comment)) {
                $this->docComment->setLines($comment);
            } elseif (is_string($comment)) {
                $this->docComment->setString($comment);
            }
        }

        return $this;
    }
1058855
protected function registerComment()
    {
        $this->app->singleton('jlourenco.comments.comment', function ($app) {
            $baseConfig = $app['config']->get('jlourenco.base');
            $config = $app['config']->get('jlourenco.comments');

            $model = array_get($config, 'models.comment');
            $users = array_get($baseConfig, 'models.User');

            if (class_exists($model) && method_exists($model, 'setUsersModel'))
                forward_static_call_array([$model, 'setUsersModel'], [$users]);

            return new CommentRepository($model);
        });
    }
1142365
public function addComment(Model $model, string $comment) : Comment
    {
        return $model->comments()->create([
            'user_id' => $this->id,
            'comment' => $comment,
        ]);
    }