Synchronizing the GitHub labels across repositories.
This repo relies upon a bespoke shell script (scripts/sync-labels.sh) that talks to the GitHub API via the
gh CLI.
Install the following tools:
gh— GitHub CLI, authenticated viagh auth loginor aGITHUB_TOKENenvironment variable with thereposcopeyq— YAML processorjust— command runner
Runjust --list to see the available commands.
To apply the labels to all repos:
just apply-allTo apply the labels to one particular repo:
just apply-repo my-repoTo preview what a sync would change without touching anything:
just dry-run my-repoLabels are defined in labels/default.yml. The just apply-repo command will preserve existing labels in the
repository, while just apply-repo-overwrite will delete any labels not listed in the YAML file.
Warning
The apply-repo-overwrite command will delete any labels that are not listed in the YAML files. Use with caution.