Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
circle

GitHub Action

Label Syncer

v1.1.0

Label Syncer

circle

Label Syncer

Sync GitHub labels in the declarative way

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Label Syncer

uses: micnncim/[email protected]

Learn more about this action in micnncim/action-label-syncer

Choose a version

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.

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

Sync labels on another repository

It is also possible to specify a repository 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: myother/repository
          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