🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@kjanat/github-labelmanager

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kjanat/github-labelmanager

Easily manage GitHub labels

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

github-labelmanager

CI Docker JSR Version NPM Version pkg.pr.new

Declaratively sync GitHub issue labels from a YAML config file.

Features

  • Create, update, and delete labels from a single config file
  • Rename labels via aliases (preserves issue associations)
  • Dry-run mode for safe previews
  • Works as CLI or GitHub Action

Install / Run

Deno

# Install globally
deno install -Agn github-labelmanager jsr:@kjanat/github-labelmanager/cli

# Run
deno run -A jsr:@kjanat/github-labelmanager/cli owner/repo

npm

# Install globally
npm install -g @kjanat/github-labelmanager

# Run
npx -y @kjanat/github-labelmanager owner/repo

Docker

# Pull the image
docker pull ghcr.io/kjanat/github-labelmanager:latest

# Run
docker run --rm \
  -e GITHUB_TOKEN=ghp_xxx \
  -v $(git rev-parse --show-toplevel)/.github:/app/.github \
  ghcr.io/kjanat/github-labelmanager owner/repo

Use as CLI

GITHUB_TOKEN=ghp_xxx github-labelmanager owner/repo

Preview changes without applying:

github-labelmanager owner/repo --dry-run
Alternative ways to run

npx (without installing)

GITHUB_TOKEN=ghp_xxx npx -y @kjanat/github-labelmanager owner/repo

Deno (without installing)

GITHUB_TOKEN=ghp_xxx deno run -A jsr:@kjanat/github-labelmanager/cli owner/repo

Docker

docker run --rm -e GITHUB_TOKEN=ghp_xxx -v $(pwd)/.github:/app/.github ghcr.io/kjanat/github-labelmanager owner/repo

Use as GitHub Action

name: Sync Labels
on:
  push:
    # Optional: trigger only when the labels file changes
    # This will however not sync manually modified labels through the GitHub UI
    paths:
      - ".github/labels.yml"
  workflow_dispatch:

jobs:
  sync:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      issues: write
    steps:
      - uses: actions/checkout@v6
      - uses: kjanat/github-labelmanager@v1
        with:
          token: ${{ github.token }}

Inputs

InputRequiredDefaultDescription
tokenYes-GitHub token with repo access
repositoryNogithub.repositoryTarget repo in owner/repo
dry-runNofalsePreview without making changes
config-pathNo.github/labels.ymlPath to label config file

Configure

Create .github/labels.yml in your repository:

# yaml-language-server: $schema=https://raw.githubusercontent.com/kjanat/github-labelmanager/master/.github/labels.schema.json
---
labels:
  - name: bug
    color: "#d73a4a"
    description: Something isn't working

  - name: feature
    color: "#a2eeef"
    description: New feature or request
    aliases: [enhancement] # Renames 'enhancement' to 'feature'

  - name: docs
    color: "#0075ca"
    description: Documentation improvements
    aliases: [documentation]

delete:
  - obsolete-label
  - another-old-label

Label schema

FieldRequiredDescription
nameYesLabel name
colorYesHex color (with or without #)
descriptionYesShort description
aliasesNoOld names to rename from

Delete labels

Add label names to the delete array to remove them.

Environment variables

VariableRequiredDescription
GITHUB_TOKENYesPersonal access token or github.token
REPONoFallback if not passed as argument
DRY_RUNNoSet to true for dry-run mode

Development

# Run locally
deno task labels owner/repo

# Dry run
deno task labels:dry-run owner/repo

# Type check
deno check --all

# Format
deno fmt

# Lint
deno lint

# Build npm package
deno task build

License

MIT

Keywords

github-labelmanager

FAQs

Package last updated on 09 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts