createReference method
Creates a new reference in a repository.
The ref is the name of the fully qualified reference
(ie: refs/heads/master).
API docs: https://developer.github.com/v3/git/refs/#create-a-reference
Implementation
Future<GitReference> createReference(
RepositorySlug slug,
String ref,
String? sha,
) {
return github.postJSON(
'/repos/${slug.fullName}/git/refs',
convert: GitReference.fromJson,
statusCode: StatusCodes.CREATED,
body: GitHubJson.encode({'ref': ref, 'sha': sha}),
);
}