https://github.com/githubtoolbox/github-label-manager
A tool for managing GitHub labels.
https://github.com/githubtoolbox/github-label-manager
github github-labels wolfsoftware
Last synced: 9 months ago
JSON representation
A tool for managing GitHub labels.
- Host: GitHub
- URL: https://github.com/githubtoolbox/github-label-manager
- Owner: GitHubToolbox
- License: mit
- Created: 2022-09-09T16:03:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-04-14T05:08:13.000Z (9 months ago)
- Last Synced: 2025-04-14T06:23:21.767Z (9 months ago)
- Topics: github, github-labels, wolfsoftware
- Language: Python
- Homepage:
- Size: 159 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
## Overview
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](config) directory. In there you will find a copy of the labels in both
[JSON](config/labels.json) and [YAML](config/labels.yml) format.
## Command Line Usage
```shell
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)
```
## Examples
### Validate the labels config file
```shell
$ github-label-manager -f config/labels.json -v
```
### Update a specific repository
```shell
$ github-label-manager -f config/labels.json -t -r
```
> Repository is in the format of organization/repo_full_name E.g. GitHubToolbox/github-label-manager
### Update all repositories for a given organization
```shell
$ github-label-manager -f config/labels.json -t -o
```
### Update all repositories for a given user
```shell
$ github-label-manager -f config/labels.json -t -u
```
### Dry Runs
You can add a -d/--dry-run to any of the 3 examples above and it will show you the changes it **would** make.
## Personal Access Tokens (PAT)
You will need to [create a PAT](https://github.com/settings/tokens) with enough permissions to be able to update the repository labels.