Skip to content

VialsShiny/template-labels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

template-labels

Simple Node.js script to synchronize a shared set of GitHub labels across multiple repositories using the GitHub REST API.

Prerequisites

  • Node.js 18 or higher installed.
  • A GitHub personal access token with permission to manage issues/labels on your repositories.

Setup

  1. Clone this repository and go into the folder:

    git clone https://github.com/VialsShiny/template-labels.git
    cd template-labels/app
  2. Make sure labels.json contains the labels you want to sync.

  3. Set the GITHUB_TOKEN environment variable in your terminal session:

    On PowerShell (Windows):

    $Env:GITHUB_TOKEN = "ghp_your_token_here"

    On macOS / Linux (bash/zsh):

    export GITHUB_TOKEN="ghp_your_token_here"

Usage

Run the script from the project root:

node sync-labels.mjs

You will be prompted for:

  • GitHub owner (user or organization name, for example toto)
  • Repos (comma‑separated list of repositories, for example my-first-repo,another-repo)

The script will then read labels.json and create the labels on each target repository.

Notes

  • Existing labels with the same name are skipped and not overwritten.
  • You can run the script multiple times to ensure new labels are added to all repositories.

About

Template-labels is a Node.js script that synchronizes a shared set of GitHub issue labels across multiple repositories using the GitHub REST API.

Topics

Resources

Stars

Watchers

Forks

Contributors