label-exporter
Export GitHub labels in the form of YAML, JSON and table.
Installation
Create a personal access token with public_repo scope at
https://github.com/settings/tokens/new and:
$ export GITHUB_TOKEN=enter_the_token_here**Note: Github will return a 404 if you try to read from a private repo. To fix this, simply change the scope of your token to include private repos as well.
Then either download a binary release from https://github.com/micnncim/label-exporter/releases or:
$ go get github.com/micnncim/label-exporter/cmd/label-exporterUsage
$ label-exporter --help
usage: label-exporter [<flags>] <owner> <repo>
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--debug Enable debug mode.
-o, --output="table" Output format. One of: json|yaml|table - default is table
Args:
<owner> Owner of the repository.
<repo> Repository whose wanted labels.Example
$ label-exporter micnncim label-exporter --output yaml
- color: d73a4a
description: Something isn't working
name: bug
- color: 0075ca
description: Improvements or additions to documentation
name: documentation
- color: cfd3d7
description: This issue or pull request already exists
name: duplicate$ label-exporter micnncim label-exporter --output json | jq
[
{
"name": "bug",
"description": "Something isn't working",
"color": "d73a4a"
},
{
"name": "documentation",
"description": "Improvements or additions to documentation",
"color": "0075ca"
},
{
"name": "duplicate",
"description": "This issue or pull request already exists",
"color": "cfd3d7"
}
]$ label-exporter micnncim label-exporter --output table
+------------------+--------------------------------+--------+
| NAME | DESCRIPTION | COLOR |
+------------------+--------------------------------+--------+
| bug | Something isn't working | d73a4a |
| documentation | Improvements or additions to | 0075ca |
| | documentation | |
| duplicate | This issue or pull request | cfd3d7 |
| | already exists | |
+------------------+--------------------------------+--------+