Kyle Harrison
Posted on February 3, 2023
Labels
(https://github.com/hackebrot/labels) is a CLI app for managing GitHub labels. It allows labels to be fetched and stored in a toml file (which can then be updated to include the required labels on another repository). Once fetched, the labels can then be synced to another repository.
Getting setup
pip install labels
export LABELS_USERNAME="apoclyps"
export LABELS_TOKEN=$GITHUB_TOKEN
Now you are ready to fetch labels from your chosen repository
Copying labels
labels fetch -o apoclyps -r reviews
This will create an output file in your current working directory called labels.toml
[bug]
color = "d73a4a"
name = "bug"
description = "Something isn't working"
[config]
color = "93447B"
name = "config"
description = ""
["contains: migrations"]
color = "EDFA48"
name = "contains: migrations"
description = ""
[dependencies]
color = "030750"
name = "dependencies"
description = ""
Syncing labels
To do a dry run using the -n
flag to see what changes would be applied
labels sync -n -o apoclyps -r deps
This would delete the following labels:
- yaml
This would update the following labels:
- contains: migrations
- dependencies
This would create the following labels:
- config
This would NOT modify the following labels:
- bug
If you are happy with the changes, rerun the same command without -n
to apply the labels to the repository:
labels sync -n -o apoclyps -r deps
💖 💪 🙅 🚩
Kyle Harrison
Posted on February 3, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.