This tool is motivated by Financial-Times/github-label-sync
This tool package is different for each provider:
Table Content
- Install .NET Core 2.2 or higher.
- Install this package.
Installed hublabel
command.
GITHUB_HOST
: using environment variable instead of argument--host
GITHUB_TOKEN
: using environment variable instead of argument-t|--token
List the all labels
Usage: hublabel list [options]
Options:
-h|--help Show help information
--host Host of Github instance, default value is https://github.com
-t|--token Token of Github
-r|--repository Target repository, value format: {Owner}/{RepositoryName}
-o|--output Output file name, including file extension
Look up current repository labels and output file.
You can response file parsing. Make file list.txt
, example:
list
--host
https://github.com
-t
YOUR_GITHUB_TOKEN
-r
REPOSITORY_OWNER/REPOSITORY_NAME
-o
output.yml
Execute command: hublabel @list.txt
Setup Github labels by option value
Usage: hublabel setup [options]
Options:
-h|--help Show help information
--host Host of Github instance, default value is https://github.com
-t|--token Token of Github
-r|--repository Target repository, value format: {Owner}/{RepositoryName}
-l|--label The labels configuration file, support json or yml file.
-d|--dry-run Calculate the required label changes, but do not apply Github
Look up current repository labels and output file.
You can response file parsing. Make file setup.txt
, example:
setup
--host
https://github.com
-t
YOUR_GITHUB_TOKEN
-r
REPOSITORY_OWNER/REPOSITORY_NAME
-l
LABEL_FILE
Execute command: hublabel @setup.txt
Support file type: JSON or YAML
example of yaml:
- name: 不具合
color: d73a4a
description: Something isn't working
aliases:
- bug
- name: 機能
color: a2eeef
description: New feature
aliases:
- enhancement
- name: Feature Request
color: 7057ff
description: New feature request
The name
and color
property is required. color
property value is color code without #
.
The description
property is optional.
The aliases
property is optional. If this property was set, its label will change to name
from alias name. So it mean label is kept.
This tool is using libraries:
- Utf8Json is published by MIT License
- YamlDotNet is published by MIT License
- Octokit is published by MIT License
- CommandLineUtils is published by Apache License v2.0
- Install .NET Core 2.2 or higher.
- Install this package.
Installed tealabel
command.
GITTEA_HOST
: using environment variable instead of argument--host
GITTEA_TOKEN
: using environment variable instead of argument-t|--token
List the all labels
Usage: tealabel list [options]
Options:
-h|--help Show help information
--host Host of Gitea instance, default value is https://try.gitea.io
-t|--token Token of Gitea
-r|--repository Target repository, value format: {Owner}/{RepositoryName}
-o|--output Output file name, including file extension
Look up current repository labels and output file.
You can response file parsing. Make file list.txt
, example:
list
--host
https://try.gitea.io
-t
YOUR_GITEA_TOKEN
-r
REPOSITORY_OWNER/REPOSITORY_NAME
-o
output.yml
Execute command: tealabel @list.txt
Setup Gitea labels by option value
Usage: tealabel setup [options]
Options:
-h|--help Show help information
--host Host of Gitea instance, default value is https://try.gitea.io
-t|--token Token of Gitea
-r|--repository Target repository, value format: {Owner}/{RepositoryName}
-l|--label The labels configuration file, support json or yml file.
-d|--dry-run Calculate the required label changes, but do not apply Gitea
Look up current repository labels and output file.
You can response file parsing. Make file setup.txt
, example:
setup
--host
https://try.gitea.io
-t
YOUR_GITEA_TOKEN
-r
REPOSITORY_OWNER/REPOSITORY_NAME
-l
LABEL_FILE
Execute command: tealabel @setup.txt
Almost the same of GitHub label file.
Support file type: JSON or YAML
example of yaml:
- id: 111
name: 不具合
color: d73a4a
description: Something isn't working
aliases:
- bug
- id: 123
name: 機能
color: a2eeef
description: New feature
aliases:
- enhancement
- name: Feature Request
color: 7057ff
description: New feature request
The id
is optional and provided by Gitea. Recomend that do not set id
.
The name
and color
property is required. color
property value is color code without #
.
The description
property is optional.
The aliases
property is optional. If this property was set, its label will change to name
from alias name. So it mean label is kept.
This tool is using libraries:
- Utf8Json is published by MIT License
- YamlDotNet is published by MIT License
- CommandLineUtils is published by Apache License v2.0
ToDo: Write test code
- Install .NET Core 2.2 or higher.
- Install this package.
Installed lablabel
command.
GITLAB_HOST
: using environment variable instead of argument--host
GITLAB_TOKEN
: using environment variable instead of argument-t|--token
List the all labels
Usage: lablabel list [options]
Options:
-h|--help Show help information
--host Host of GitLab instance, default value is https://gitlab.com
-t|--token Token of GitLab
-r|--repository Target repository, value format: {Owner}/{RepositoryName}
-o|--output Output file name, including file extension
Look up current repository labels and output file.
You can response file parsing. Make file list.txt
, example:
list
--host
https://gitlab.com
-t
YOUR_GITEA_TOKEN
-r
REPOSITORY_OWNER/REPOSITORY_NAME
-o
output.yml
Execute command: lablabel @list.txt
Setup GitLab labels by option value
Usage: lablabel setup [options]
Options:
-h|--help Show help information
--host Host of GitLab instance, default value is https://gitlab.com
-t|--token Token of GitLab
-r|--repository Target repository, value format: {Owner}/{RepositoryName}
-l|--label The labels configuration file, support json or yml file.
-d|--dry-run Calculate the required label changes, but do not apply GitLab
Look up current repository labels and output file.
You can response file parsing. Make file setup.txt
, example:
setup
--host
https://gitlab.com
-t
YOUR_GITEA_TOKEN
-r
REPOSITORY_OWNER/REPOSITORY_NAME
-l
LABEL_FILE
Execute command: lablabel @setup.txt
Almost the same of GitHub label file.
Support file type: JSON or YAML
example of yaml:
- id: 111
name: 不具合
color: d73a4a
description: Something isn't working
priority: 2
aliases:
- bug
- id: 123
name: 機能
color: a2eeef
description: New feature
aliases:
- enhancement
- name: Feature Request
color: 7057ff
description: New feature request
The id
is optional and provided by Gitea. Recomend that do not set id
.
The name
and color
property is required. color
property value is color code without #
.
The description
property is optional.
The priority
property is optional, it is integer.
The aliases
property is optional. If this property was set, its label will change to name
from alias name. So it mean label is kept.
This tool is using libraries:
- Utf8Json is published by MIT License
- YamlDotNet is published by MIT License
- CommandLineUtils is published by Apache License v2.0
- GitLabApiClient is published by MIT License
This tools is under MIT License
ToDo: Write
- C# 8.0
- Visual Studio 2019
Author: @MeilCli