LinuxCommandLibrary

github-label-sync

Synchronize GitHub repository labels

TLDR

Synchronize labels using a local labels.json file

$ github-label-sync --access-token [token] [repository_name]
copy

Synchronize labels using a specific labels JSON file
$ github-label-sync --access-token [token] --labels [url|path/to/json_file] [repository_name]
copy

Perform a dry run instead of actually synchronizing labels
$ github-label-sync --access-token [token] --dry-run [repository_name]
copy

Keep labels that aren't in labels.json
$ github-label-sync --access-token [token] --allow-added-labels [repository_name]
copy

Synchronize using the $GITHUB_ACCESS_TOKEN environment variable
$ github-label-sync [repository_name]
copy

SYNOPSIS

github-label-sync [OPTIONS] <target-repos...>

PARAMETERS

--access-token <TOKEN>
    GitHub Personal Access Token (env: GITHUB_TOKEN)

--color <WHEN>
    Control colors: always|never|auto (default: auto)

--dry-run
    Preview changes without applying them

--ignore-missing-labels
    Do not delete labels missing in source

--labels-file <FILE>
    JSON/YAML file with custom label definitions

--merge-labels
    Merge labels instead of overwriting

--repo <REPO>
    Source repo for labels (default: current dir)

--verbose
    Enable verbose logging

-h, --help
    Print help

-V, --version
    Print version

DESCRIPTION

github-label-sync is a command-line tool for synchronizing labels between GitHub repositories. It ensures consistent labeling across multiple repos by copying labels from a source repository to one or more targets. Labels are created, updated, or deleted to match the source exactly.

Perfect for teams and organizations enforcing standardized issue and PR labels. Define labels via repository metadata or a custom JSON/YAML file. Features include dry-run mode for safe testing, ignoring missing labels, and merging from multiple sources.

Requires a GitHub Personal Access Token with repo scope. Installed via Cargo (Rust package manager): cargo install github-label-sync. Supports color output control and verbose logging.

Usage simplifies maintenance, reducing manual label management errors and saving time on large codebases with dozens of repos.

CAVEATS

Requires GitHub token with repo:write scope.
Rate-limited by GitHub API; large orgs may hit limits.
Not affiliated with GitHub.

INSTALLATION

Run cargo install github-label-sync or download binaries from releases.

LABEL FORMAT

Supports name, color (hex), description; e.g., {'name': 'bug', 'color': 'CC0000', 'description': 'Bug report'}.

HISTORY

Developed by Stefan Buck in 2018 as open-source Rust tool. Active on GitHub (stefanbuck/github-label-sync), with regular updates for API changes and features like YAML support.

SEE ALSO

git(1), gh(1)

Copied to clipboard