Skip to content

blackysky/github-label-cloner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-label-cloner

A simple Python script to clone GitHub Issue Labels from one repository to another.

GitHub Labels are really useful for organising issues and pull requests, especially when you use them with GitHub Projects.
This script helps you set up new repositories with a ready-made label structure copied from your ideal project.

Example run of github-label-cloner


🚀 Features

  • Copies all labels from one repo to another
  • Removes existing labels in target repo by default
  • Supports --keep-existing flag to preserve existing labels
  • Fast and parallel (async, based on httpx)
  • Uses GitHub API via a personal token

🔧 Requirements

Install dependencies:

pip install -r requirements.txt

🛠️ Usage

python copy_labels.py \
  --token YOUR_GITHUB_TOKEN \
  --source username/repo-from \
  --target username/repo-to

To preserve existing labels in the target repo, use the --keep-existing flag:

python copy_labels.py \
  --token YOUR_GITHUB_TOKEN \
  --source username/repo-from \
  --target username/repo-to \
  --keep-existing

You can also provide environment variables instead of flags:

  • GITHUB_TOKEN
  • SOURCE_REPO
  • TARGET_REPO

🪪 License

This project is licensed under the MIT Licence.

About

A simple Python script to clone GitHub Issue Labels between repositories.

Topics

Resources

License

Stars

Watchers

Forks

Languages