Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Latest commit

 

History

History
85 lines (71 loc) · 2.14 KB

README.md

File metadata and controls

85 lines (71 loc) · 2.14 KB

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

Then either download a binary release from https://github.com/micnncim/label-exporter/releases or:

$ go get github.com/micnncim/label-exporter/cmd/label-exporter

Usage

$ label-exporter --help
usage: label-exporter [<flags>] <owner> <repo>

Flags:
      --help   Show context-sensitive help (also try --help-long and --help-man).
  -y, --yaml   Use the YAML format.
  -j, --json   Use the JSON format.
  -t, --table  Use the table format.

Args:
  <owner>  Owner of the repository.
  <repo>   Repository whose wanted labels.

Example

$ label-exporter micnncim label-exporter --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 --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 --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                 |        |
+------------------+--------------------------------+--------+