createLabel method
Future<IssueLabel>
createLabel(
- RepositorySlug slug,
- String name, {
- String? color,
- String? description,
Creates a new label on the specified repository.
API docs: https://developer.github.com/v3/issues/labels/#create-a-label
Implementation
Future<IssueLabel> createLabel(
RepositorySlug slug,
String name, {
String? color,
String? description,
}) {
return github.postJSON(
'/repos/${slug.fullName}/labels',
body: GitHubJson.encode({
'name': name,
if (color != null) 'color': color,
if (description != null) 'description': description,
}),
convert: IssueLabel.fromJson,
);
}