createComment method

Future<PullRequestComment> createComment(
  1. RepositorySlug slug,
  2. int number,
  3. CreatePullRequestComment comment
)

Creates a new pull request comment.

API docs: https://developer.github.com/v3/pulls/comments/#create-a-comment

Implementation

Future<PullRequestComment> createComment(
  RepositorySlug slug,
  int number,
  CreatePullRequestComment comment,
) {
  return github.postJSON(
    '/repos/${slug.fullName}/pulls/$number/comments',
    body: GitHubJson.encode(comment.toJson()),
    convert: PullRequestComment.fromJson,
    statusCode: 201,
  );
}