This script is designed to allow you to manage the labels on your GitHub repositories. Labels are used to categorize issues, pull requests, and discussions.
Keeping all your labels consistent makes it easier to work across multiple repositories (and organisations)
We currently manage over 100 repositories across more than 15 organisations so it is important to reduce any friction when moving between project to deal with issues pr pull requests.
To get you started we have also included a copy of the config that we use for all of the repositories we manage, you can find that in the config directory. In there you will find a copy of the labels in both JSON and YAML format.
usage: github-label-manager [-h] [-d] [-v] [-j | -y] [-t TOKEN] -f FILENAME [-u USER | -o ORG | -r REPO]
Setup labels on git repository.
flags:
  -h, --help            show this help message and exit.
  -d, --dry-run         Perform a dry run (default: False)
  -v, --validate        Validate local labels (default: False)
mutually exclusive flags:
  -j, --json            JSON formatted config file (default: True)
  -y, --yaml            YAML formatted config file (default: False)
selective:
  -t TOKEN, --token TOKEN
                        GitHub token (needed for everything except -v/--validate) (default: None)
required:
  -f FILENAME, --filename FILENAME
                        File containing labels (default: None)
mutually exclusive:
  -u USER, --user USER  Specify username (default: None)
  -o ORG, --org ORG     Specify organization (default: None)
  -r REPO, --repo REPO  Specify repository (default: None)$ github-label-manager -f config/labels.json -v$ github-label-manager -f config/labels.json -t <PAT> -r <Repository>Repository is in the format of organization/repo_full_name E.g. GitHubToolbox/github-label-manager
$ github-label-manager -f config/labels.json -t <PAT> -o <Organisation>$ github-label-manager -f config/labels.json -t <PAT> -u <username>You can add a -d/--dry-run to any of the 3 examples above and it will show you the changes it would make.
You will need to create a PAT with enough permissions to be able to update the repository labels.