Skip to content

Configure GitHub labels in one place. Sync changes to target repositories with a single command.

Notifications You must be signed in to change notification settings

madikarizma/github-labels-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Labels Sync

Managing default repository labels via GitHub is time-consuming and inefficient. This project accomplishes 2 things:

  1. Configure labels for single or groups of repositories in one place.
  2. Run a single command to sync changes to each target repository.

Getting started

Generate a new GitHub access token

  1. You must generate a GitHub access token to access the repositories targeted by this project.
  2. You must have permission to make changes to any repositories you reference in your config.json.

Create a .env file

Add the following line to your .env file and replace xxxxx with your generated GitHub access token.

GITHUB_ACCESS_TOKEN="xxxxx"

Please note: while .env is already included in the .gitignore file, it important to remember this file should never be committed. Since your GitHub access token is considered sensitive information, committing it would create a security vulnerability for the company.

Install dependencies

yarn

Configure labels

With config.json you can as many collections of labels as you'd like and have them sync with as many repositories as you'd like.

Example config.json

[
  {
    "repos": [
      "madikarizma/repository-1",
      "madikarizma/repository-2",
      "madikarizma/repository-3"
    ],
    "labels": [
      {
        "name": "status: ready",
        "description": "Ready for development",
        "color": "15803D",
        "aliases": []
      },
      {
        "name": "status: in progress",
        "description": "Development has started",
        "color": "4F46E5",
        "aliases": []
      },
      {
        "name": "status: blocked",
        "description": "Blocked on some issue",
        "color": "DC2626",
        "aliases": []
      },
      {
        "name": "status: released",
        "description": "Released to production",
        "color": "2563EB",
        "aliases": []
      }
    ]
  },
  {
    "repos": [
      "madikarizma/repository-4"
    ],
    "labels": [
      {
        "name": "status: todo",
        "description": "Waiting to start",
        "color": "15803D",
        "aliases": []
      },
      {
        "name": "status: in progress",
        "description": "Work has begun",
        "color": "4F46E5",
        "aliases": []
      },
      {
        "name": "status: done",
        "description": "Work is done",
        "color": "2563EB",
        "aliases": []
      }
    ]
  }
]

Sync labels

yarn sync

About

Configure GitHub labels in one place. Sync changes to target repositories with a single command.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published