createCheckSuite method

Future<CheckSuite> createCheckSuite(
  1. RepositorySlug slug, {
  2. required String headSha,
})

By default, check suites are automatically created when you create a check run. You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "Set preferences for check suites on a repository". Your GitHub App must have the checks:write permission to create check suites.

  • headSha: The sha of the head commit.

API docs: https://developer.github.com/v3/checks/suites/#create-a-check-suite

Implementation

Future<CheckSuite> createCheckSuite(
  RepositorySlug slug, {
  required String headSha,
}) {
  ArgumentError.checkNotNull(headSha);
  return github.requestJson<Map<String, dynamic>, CheckSuite>(
    'POST',
    'repos/$slug/check-suites',
    statusCode: StatusCodes.CREATED,
    preview: _previewHeader,
    params: {'head_sha': headSha},
    convert: CheckSuite.fromJson,
  );
}