createReviewComment method

Future<ReviewComment> createReviewComment({
  1. required String repo,
  2. required int num,
  3. required String body,
  4. required String commitId,
  5. required String path,
  6. required int line,
})

gh api
--method POST
-H "Accept: application/vnd.github.v3+json"
/repos/{repo}/pulls/{num}/comments
-f body={body}
-f commit_id={commitId}
-f path={path}
-F line={line}

Implementation

Future<ReviewComment> createReviewComment({
  required String repo,
  required int num,
  required String body,
  required String commitId,
  required String path,
  required int line,
}) async {
  final result = await _runner.run([
    'api',
    '--method',
    'POST',
    '-H',
    'Accept: application/vnd.github.v3+json',
    '/repos/$repo/pulls/$num/comments',
    '-f',
    'body=$body',
    '-f',
    'commit_id=$commitId',
    '-f',
    'path=$path',
    '-F',
    'line=$line',
  ]);

  return ReviewComment.fromJson(jsonDecode(result));
}