An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          



GitHubToolbox logo




Github Build Status


License


Created




Release


Released


Commits since release















## 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.