testPushHook method

Future<bool> testPushHook(
  1. RepositorySlug slug,
  2. int id
)

Triggers a hook with the latest push.

API docs: https://developer.github.com/v3/repos/hooks/#test-a-push-hook

Implementation

Future<bool> testPushHook(RepositorySlug slug, int id) async {
  ArgumentError.checkNotNull(slug);
  ArgumentError.checkNotNull(id);
  return github
      .request(
        'POST',
        '/repos/${slug.fullName}/hooks/$id/tests',
        statusCode: StatusCodes.NO_CONTENT,
      )
      .then((response) => response.statusCode == StatusCodes.NO_CONTENT);
}