github-label-sync icon indicating copy to clipboard operation
github-label-sync copied to clipboard

Feature Request: Download labels via CLI

Open Nuru opened this issue 2 years ago • 0 comments

Feature Request

Using the CLI, I would like to be able to download the existing set of labels from a repository or from the organization's repository defaults (https://github.com/organizations/<org>/settings/repository-defaults) to use as the basis for the labels to set. It is fine with me if the CLI would simply output the list in a format the CLI would accept as input, allowing me to then edit it. I would prefer the option to have it emitted in JSON or YAML.

Details

We consider the GitHub organization's Repository Defaults to be the "source of truth" and like that we can update it via a nice UI. We would like to use github-label-sync to propagate changes to the defaults to any existing repositories in an automated way by reading the defaults and applying them.

In another org, I would like to download the defaults, manually remove outdated labels, and then sync them.

As it is, I have to manually create a configuration that matches the defaults, which is tedious and error prone.

# Read org defaults and output as YAML
github-label-sync --read-only --format yaml myname

# Read repo labels and output as JSON
github-label-sync --read-only  myname/repo

Nuru avatar Apr 13 '22 19:04 Nuru