Skip to content

ecoAPM/GitHubLabelSync

Repository files navigation

GitHub Label Sync

Synchronize GitHub issue labels across repositories

NuGet version CI Coverage

Maintainability Rating Reliability Rating Security Rating

Requirements

  • .NET 8 SDK

Installation

~$ dotnet tool install -g GitHubLabelSync

Setup

  • Generate a Personal Access Token in GitHub from https://github.com/settings/tokens/new with the following access:
    • repo
    • delete_repo
  • keep this key/token in a safe and private place, as you'll need it to sync your labels

Wait, why do I need to give delete_repo rights? That sounds scary!

Good question!

The GitHub API does not provide direct access to default labels, and so they are obtained by creating (and immediately deleting) a temporary private repository.

You can see the code that performs these actions here.

Usage

~$ sync-labels <org/username> [options]

This tool is designed for GitHub organization administrators, as organizations have the ability to set the default labels for new repositories.

Individual users are limited to GitHub's default set of issue labels, but this tool can still be used to ensure all of your repositories have the latest set.

Options

  • -k or --api-key: (required) GitHub API Key (Personal Access Token)
  • -f or --filter: only sync repositories that match the provided regular expression
  • -a or --no-add: do not add new labels
  • -e or --no-edit: do not edit existing labels
  • -d or --no-delete: do not delete stale labels
  • -r or --dry-run: do not perform any actions (equivalent to -a -e -d)
  • -h or --help: view this information from the command line

Contributing

Please be sure to read and follow ecoAPM's Contribution Guidelines when submitting issues or pull requests.