All Projects → b4b4r07 → Github Labeler

b4b4r07 / Github Labeler

Declarative way to configure GitHub labels

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Github Labeler

Manifests
kubernetes manifests and documentation
Stars: ✭ 39 (-37.1%)
Mutual labels:  yaml
Legivel
F# Yaml 1.2 parser
Stars: ✭ 47 (-24.19%)
Mutual labels:  yaml
Feedr
Use feedr to fetch the data from a remote url, respect its caching, and parse its data. Despite its name, it's not just for feed data but also for all data that you can feed into it (including binary data).
Stars: ✭ 56 (-9.68%)
Mutual labels:  yaml
Fast yaml
Fast YAML native library for Erlang / Elixir
Stars: ✭ 40 (-35.48%)
Mutual labels:  yaml
I18nplugin
Intellij idea i18next support plugin
Stars: ✭ 43 (-30.65%)
Mutual labels:  yaml
Ansible Config encoder filters
Ansible role used to deliver the Config Encoder Filters.
Stars: ✭ 48 (-22.58%)
Mutual labels:  yaml
Configr
Implements the JSON, INI, YAML and TOML parser, for R setting and writing of configuration file.
Stars: ✭ 38 (-38.71%)
Mutual labels:  yaml
Re Txt
converts text-formats from one to another, it is very useful if you want to re-format a json file to yaml, toml to yaml, csv to yaml, ... etc
Stars: ✭ 59 (-4.84%)
Mutual labels:  yaml
Zaml
The Final Form of configuration files
Stars: ✭ 45 (-27.42%)
Mutual labels:  yaml
Communityscrapers
This is a public repository containing scrapers created by the Stash Community.
Stars: ✭ 51 (-17.74%)
Mutual labels:  yaml
Home Assistant Config
My Home Assistant configuration
Stars: ✭ 41 (-33.87%)
Mutual labels:  yaml
Bashful
Use a yaml file to stitch together commands and bash snippits and run them with a bit of style. Why? Because your bash script should be quiet and shy-like (...and not such a loud mouth).
Stars: ✭ 1,018 (+1541.94%)
Mutual labels:  yaml
Resticprofile
Configuration profiles for restic backup
Stars: ✭ 48 (-22.58%)
Mutual labels:  yaml
Emrichen
A Template engine for YAML & JSON
Stars: ✭ 40 (-35.48%)
Mutual labels:  yaml
Yaml2go
Converts YAML specs into Go Lang type definitions
Stars: ✭ 57 (-8.06%)
Mutual labels:  yaml
Hyperpotamus
🥋 YAML/JSON automation scripting 🤺
Stars: ✭ 38 (-38.71%)
Mutual labels:  yaml
Shon
A simple tool to convert json or yaml into a shell-compliant data structure.
Stars: ✭ 47 (-24.19%)
Mutual labels:  yaml
Vim Yaml Folds
YAML, RAML, EYAML & SaltStack SLS folding for Vim
Stars: ✭ 59 (-4.84%)
Mutual labels:  yaml
Hiyapyco
HiYaPyCo - A Hierarchical Yaml Python Config
Stars: ✭ 58 (-6.45%)
Mutual labels:  yaml
Yglu
Yglu ᕄ !? - YAML glue for structural templating and processing
Stars: ✭ 51 (-17.74%)
Mutual labels:  yaml

GitHub labels as a Code!

CLI that sets GitHub labels exactly as written in YAML file

Concepts

  • Create a label (e.g. when no label described in YAML)
  • Edit a label (e.g. when its color was changed)
  • Delete a label (e.g. when the label not described in YAML exists on GitHub)

YAML example

labels:
  - name: kind/proactive
    description: Categorizes issue or PR as related to proactive tasks.
    color: 9CCC65
  - name: kind/reactive
    description: Categorizes issue or PR as related to reactive tasks.
    color: FFA000

repos:
  - name: org/repo
    labels:
      - kind/proactive
      - kind/reactive

Run as GitHub Actions

YAML for defined labels

You can put this file to anywhere as you like. It defaults to .github/labels.yml. This is the config file to define the labels. Basically it means GitHub labels are configured as this file defines.

.github/labels.yml
labels:
- name: help wanted
  description: Extra attention is needed
  color: "008672"
- name: bug
  description: Something isn't working
  color: fc2929
- name: enhancement
  description: New feature or request
  color: 84b6eb
- name: question
  description: Further information is requested
  color: cc317c
repos:
- name: user/repo
  labels:
  - help wanted
  - bug
  - enhancement
  - question

YAML for workflows to sync labels between existing one and defined one

This is the one of the workflow of this app. It means to do the same with GitHub Actions as running github-labeler on your local machine.

.github/workflows/sync_labels.yml
name: Sync labels

on:
  push:
    branches:
      - master
    paths:
      - .github/labels.yml

jobs:
  sync:
    name: Run
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/[email protected]
      - name: Sync labels
        uses: b4b4r07/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

If you want to make sure what changes to be applied in a pull request step, you can run github-labeler with dryrun option. By having action-github-comment step, you can also post the github-labeler result to the GitHub comment.

.github/workflows/sync_labels_dryrun.yml
name: Sync labels

on: [pull_request]

jobs:
  sync:
    name: Dry run
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/[email protected]
      - name: Sync labels with dryrun option
        uses: b4b4r07/[email protected]
        with:
          dryrun: 'true'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        id: labeler
      - name: Post github-labeler command result to GitHub comment
        uses: b4b4r07/[email protected]
        if: steps.labeler.outputs.result
        with:
          body: |
            ## github-labeler result
            ```
            ${{ steps.labeler.outputs.result }}
            ```
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LOG: trace

YAML for workflows to import labels from existing one to defined one

This is the workflow to import your existing labels on GitHu to the definition YAML. Even if you define the labels on YAML file, someone may change the label information or create new one on GitHub (Web UI). If so, these labels updating should be synced with the definition file. In order to solve those problems, this workflow imports label-related changes triggered by events of labels activities.

.github/workflows/import_labels.yml
name: Import labels

on:
  label:
    types:
      - created
      - edited
      - deleted

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/[email protected]
      - name: Import between existing labels
        uses: b4b4r07/[email protected]
        with:
          import: 'true'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Create Pull Request
        uses: peter-evans/[email protected]
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-message: "Import existing labels"
          title: "Import existing labels"
          body: |
            ## WHAT
            This pull request was created by [create-pull-request](https://github.com/peter-evans/create-pull-request).
            ## WHY
            Current labels.yaml and existing labels don't match.
          branch: import-labels
          branch-suffix: timestamp

Installation

Download the binary from GitHub Releases and drop it in your $PATH.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].