takolabel
is a CLI tool for manipulating GitHub Labels across multiple repositories.
$ brew install tnagatomi/tap/takolabel
Download packaged binaries from Releases page in this repository.
Set environment variables below (via export
command etc.).
- TAKOLABEL_TOKEN (required)
- GitHub Personal access token. A token with
repo
scope is needed if it will be run on a private repository.public_repo
scope will suffice if it's a public repository.
- GitHub Personal access token. A token with
- TAKOLABEL_HOST (optional)
- Set this variable to the host URL (e.g.
https://ghe.example.com/
) if you want to work with repositories hosted on GitHub Enterprise Server. Manipulations will take place ingithub.com
repositories if you didn't set this variable.
- Set this variable to the host URL (e.g.
--dry-run
for all operations are supported.
$ takolabel create
Create labels to the repositories specified in the YAML file.
Write labels settings in takolabel_create.yml
and put in the same directory as the one where you run the command.
e.g.
repositories:
- some-owner/some-owner-repo-1
- some-owner/some-owner-repo-2
- another-owner/another-owner-repo-1
labels:
- name: Label 1
description: This is the label one
color: ff0000
- name: Label 2
description: This is the label two
color: 00ff00
- name: Label 3
description: This is the label three
color: 0000ff
$ takolabel delete
Delete labels in the repositories specified in the YAML file.
Write labels settings in takolabel_delete.yml
and put in the same directory as the one where you run the command.
e.g.
repositories:
- some-owner/some-owner-repo-1
- some-owner/some-owner-repo-2
- another-owner/another-owner-repo-1
labels:
- Label 1
- Label 2
- Label 3
$ takolabel sync
Sync labels in the repositories to those of specified in the YAML file.
Write labels settings in takolabel_sync.yml
and put in the same directory as the one where you run the command.
e.g.
repositories:
- some-owner/some-owner-repo-1
- some-owner/some-owner-repo-2
- another-owner/another-owner-repo-1
labels:
- name: Label 1
description: This is the label one
color: ff0000
- name: Label 2
description: This is the label two
color: 00ff00
- name: Label 3
description: This is the label three
color: 0000ff
$ takolabel empty
Delete all the labels in the repositories specified in the YAML file.
Write repositories settings in takolabel_empty.yml
and put in the same directory as the one where you run the command.
e.g.
repositories:
- some-owner/some-owner-repo-1
- some-owner/some-owner-repo-2
- another-owner/another-owner-repo-1