Feature Request: Download labels via CLI
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
Currently, there is no way to retrieve Organization default GitHub issue label by REST API natively. The cloest possible way is creating new repository and use https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#list-labels-for-a-repository
There's an ongoing feature request in github community discussion https://github.com/orgs/community/discussions/157552