• Stars
    star
    191
  • Rank 202,877 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GitHub Action to sync GitHub labels in the declarative way

logo

actions-workflow-test actions-marketplace release pkg.go.dev dependabot license

GitHub Actions workflow to sync GitHub labels in the declarative way.

By using this workflow, you can sync current labels with labels configured in a YAML manifest.

Usage

Create YAML manifest of GitHub labels

- name: bug
  description: Something isn't working
  color: d73a4a
- name: documentation
  description: Improvements or additions to documentation
  color: 0075ca
- name: duplicate
  description: This issue or pull request already exists
  color: cfd3d7

The default file path is .github/labels.yml, but you can specify any file path with jobs.<job_id>.steps.with.manifest.

To create manifest of the current labels easily, using label-exporter is recommended.

Create Workflow

An example workflow is here.

name: Sync labels
on:
  push:
    branches:
      - master
    paths:
      - path/to/manifest/labels.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: micnncim/action-label-syncer@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          manifest: path/to/manifest/labels.yml

If a label color or description changes, the same label is updated with the new color or description. If a label name changes, the previous label is deleted by default. Also all existing labels which not listed in manifest will be deleted by default. All issues and PRs that were previously labeled with this label are now unlabeled.

You can add jobs.<job_id>.steps.with.prune: false in order to preserver all existing labels which is not mentioned in manifest, in this case when a label will be renamed old label will be not deleted.

Sync labels on another repository

It is also possible to specify a repository or repositories as an input to the action. This is useful if you want to store your labels somewhere centrally and modify multiple repository labels.

Note: The default GITHUB_TOKEN will not have permissions to operate on other repositories so you must specify a personal access token in your secrets.

name: Sync labels
on:
  push:
    branches:
      - master
    paths:
      - path/to/manifest/labels.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: micnncim/action-label-syncer@v1
        with:
          manifest: path/to/manifest/labels.yml
          repository: |
              owner/repository-1
              owner/repository-2
          token: ${{ secrets.PERSONAL_TOKEN }}

Project using action-label-syncer

If you're using action-label-syncer in your project, please send a PR to list your project!

See also

Note

Icon made by bqlqn from www.flaticon.com

More Repositories

1

kubectl-reap

kubectl plugin that deletes unused Kubernetes resources
Go
195
star
2

action-lgtm-reaction

GitHub Action to send LGTM reaction
Go
78
star
3

protocol-buffers-language-server

[WIP] Protocol Buffers Language Server
Go
59
star
4

go-set

Go package for sets implemented with generics
Go
44
star
5

github-sprinter

CLI managing GitHub milestones as sprints
Go
17
star
6

label-exporter

Exporter of GitHub labels in the form YAML, JSON and table.
Go
12
star
7

bitbrew

BitBar plugin manager
Go
11
star
8

stardust

Report a summary of GitHub repositories you recently have starred
Go
9
star
9

docker-grpc-gateway

Dockerfile for grpc-gateway and golang
Dockerfile
9
star
10

homebrew-go

Homebrew Go client
Go
7
star
11

gh-project

GitHub CLI extension for listing projects and linking/unlinking projects to/from issues/PRs interactively.
Shell
7
star
12

repoconfig

CLI to update GitHub repository config in the interactive way
Go
6
star
13

go-secretresolver

Transparently resolve secret references for secret managers
Go
5
star
14

speakerdeck-searcher

The CLI searcher for Speaker Deck
Go
5
star
15

spincue

CUE implementation of Spinnaker pipelines
4
star
16

raycast-extension-golinks

A Raycast Extension for GoLinks
TypeScript
4
star
17

chcase

CLI changing string cases
Go
3
star
18

gctx

Shell
2
star
19

yreq

Send multiple HTTP POST requests by JSON using YAML file
Go
2
star
20

.kubernetes

A template repository for Kubernetes
1
star
21

.nvim

Neovim config
Vim Script
1
star
22

medicine

Support syntax highlighting on Medium
Go
1
star
23

sample-controller

Go
1
star
24

ft

File transferer with gRPC
Go
1
star
25

pre-commit-hooks-cue

1
star
26

micnncim

1
star
27

kubetools

Collection of miscellaneous tools for Kubernetes
Go
1
star
28

gh-sync

Shell
1
star
29

slackctl

Slack command line tool
Go
1
star
30

nix-shell-example

nix-shell-example
Nix
1
star
31

raycast-extension-open-link-in-notion

raycast-extension-open-link-in-notion
TypeScript
1
star
32

octo

Yet another CLI that makes easier to use with GitHub
Go
1
star
33

terraform-cloud-functions

HCL
1
star