MobileAct / GithubLabelSetUpper

GitHub/Gitea Label tool for template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GithubLabelSetUpper

Build Status NuGet version
This tool is motivated by Financial-Times/github-label-sync

This tool package is different for each provider:

Table Content

GitHub

Usage

  1. Install .NET Core 2.2 or higher.
  2. Install this package.

Installed hublabel command.

Environment Variables

  • GITHUB_HOST: using environment variable instead of argument --host
  • GITHUB_TOKEN: using environment variable instead of argument -t|--token

Commands

List labels

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 Labels

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

Label file

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.

License

This tool is using libraries:

Gitea

Usage

  1. Install .NET Core 2.2 or higher.
  2. Install this package.

Installed tealabel command.

Environment Variables

  • GITTEA_HOST: using environment variable instead of argument --host
  • GITTEA_TOKEN: using environment variable instead of argument -t|--token

Commands

List labels

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 Labels

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

Label file

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.

License

This tool is using libraries:

GitLab

ToDo: Write test code

Usage

  1. Install .NET Core 2.2 or higher.
  2. Install this package.

Installed lablabel command.

Environment Variables

  • GITLAB_HOST: using environment variable instead of argument --host
  • GITLAB_TOKEN: using environment variable instead of argument -t|--token

Commands

List labels

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 Labels

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

Label file

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.

License

This tool is using libraries:

License

This tools is under MIT License

Other

Contribute

ToDo: Write

Development Environment

  • C# 8.0
  • Visual Studio 2019

Other

Author: @MeilCli

About

GitHub/Gitea Label tool for template

License:MIT License


Languages

Language:C# 100.0%