Skip to content

Repository files navigation

GithubLabelSetUpper

Build StatusNuGet 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: d73a4adescription: Something isn't workingaliases:
- bug
- name: 機能color: a2eeefdescription: New featurealiases:
- enhancement
- name: Feature Requestcolor: 7057ffdescription: 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: 111name: 不具合color: d73a4adescription: Something isn't workingaliases:
- bug
- id: 123name: 機能color: a2eeefdescription: New featurealiases:
- enhancement
- name: Feature Requestcolor: 7057ffdescription: 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: 111name: 不具合color: d73a4adescription: Something isn't workingpriority: 2aliases:
- bug
- id: 123name: 機能color: a2eeefdescription: New featurealiases:
- enhancement
- name: Feature Requestcolor: 7057ffdescription: 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

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages