Giter VIP home page Giter VIP logo

action-label-syncer's Introduction

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

action-label-syncer's People

Contributors

br3ndonland avatar dependabot-preview[bot] avatar hugovk avatar jacobtomlinson avatar maxarndt avatar micnncim avatar poeschl avatar slawekjaranowski avatar tvvignesh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.