Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/micnncim/action-label-syncer

GitHub Action to sync GitHub labels in the declarative way
https://github.com/micnncim/action-label-syncer

actions automation github github-actions labels manifest sync-github-labels

Last synced: 20 days ago
JSON representation

GitHub Action to sync GitHub labels in the declarative way

Awesome Lists containing this project

README

        

![logo](docs/assets/logo.png)

[![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test]
[![actions-marketplace][actions-marketplace-badge]][actions-marketplace]
[![release][release-badge]][release]
[![pkg.go.dev][pkg.go.dev-badge]][pkg.go.dev]
[![dependabot][dependabot-badge]][dependabot]
[![license][license-badge]][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

```yaml
- 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
```

![](docs/assets/screenshot.png)

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

To create manifest of the current labels easily, using [label-exporter](https://github.com/micnncim/label-exporter) is recommended.

### Create Workflow

An example workflow is here.

```yaml
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..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.**

```yaml
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

- [cloudalchemy/ansible-prometheus](https://github.com/cloudalchemy/ansible-prometheus)
- [cloudalchemy/ansible-grafana](https://github.com/cloudalchemy/ansible-grafana)
- [cloudalchemy/ansible-node-exporter](https://github.com/cloudalchemy/ansible-node-exporter)
- [cloudalchemy/ansible-fluentd](https://github.com/cloudalchemy/ansible-fluentd)
- [cloudalchemy/ansible-alertmanager](https://github.com/cloudalchemy/ansible-alertmanager)
- [cloudalchemy/ansible-blackbox-exporter](https://github.com/cloudalchemy/ansible-blackbox-exporter)
- [cloudalchemy/ansible-pushgateway](https://github.com/cloudalchemy/ansible-pushgateway)
- [cloudalchemy/ansible-coredns](https://github.com/cloudalchemy/ansible-coredns)
- [sagebind/isahc](https://github.com/sagebind/isahc)
- [JulienBreux/baleia](https://github.com/JulienBreux/baleia)
- [Simplify4U](https://github.com/s4u)
- [Poeschl's Home Assistant Addons](https://github.com/Poeschl/Hassio-Addons)
- [The Guild - Master Labels](https://github.com/the-guild-org/shared-resources)
- [The Guild - GraphQL Codegen](https://github.com/dotansimha/graphql-code-generator)
- [The Guild - GraphQL ESLint](https://github.com/dotansimha/graphql-eslint)
- [The Guild - Apollo Angular](https://github.com/kamilkisiela/apollo-angular)
- [The Guild - GraphQL Config](https://github.com/kamilkisiela/graphql-config)
- [The Guild - GraphQL Mesh](https://github.com/Urigo/graphql-mesh)
- [The Guild - GraphQL Modules](https://github.com/Urigo/graphql-modules)
- [The Guild - GraphQL Inspector](https://github.com/kamilkisiela/graphql-inspector)
- [The Guild - GraphQL Tools](https://github.com/ardatan/graphql-tools)
- [The Guild - GraphQL Scalars](https://github.com/Urigo/graphql-scalars)
- [The Guild - Whatsapp Clone](https://github.com/Urigo/WhatsApp-Clone-Tutorial)
- [The Guild - GraphQL CLI](https://github.com/Urigo/graphql-cli)
- [The Guild - SOFA](https://github.com/Urigo/SOFA)

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

## See also

- [Prow](https://github.com/kubernetes/test-infra/tree/master/prow)
- [actions/labeler](https://github.com/actions/labeler)
- [lannonbr/issue-label-manager-action](https://github.com/lannonbr/issue-label-manager-action)
- [b4b4r07/github-labeler](https://github.com/b4b4r07/github-labeler)

## Note

_Icon made by bqlqn from [www.flaticon.com](https://www.flaticon.com)_

[actions-workflow-test]: https://github.com/micnncim/action-label-syncer/actions?query=workflow%3ACI
[actions-workflow-test-badge]: https://img.shields.io/github/workflow/status/micnncim/action-label-syncer/CI?label=CI&style=for-the-badge&logo=github
[actions-marketplace]: https://github.com/marketplace/actions/label-syncer
[actions-marketplace-badge]: https://img.shields.io/badge/marketplace-label%20syncer-blue?style=for-the-badge&logo=github
[release]: https://github.com/micnncim/action-label-syncer/releases
[release-badge]: https://img.shields.io/github/v/release/micnncim/action-label-syncer?style=for-the-badge&logo=github
[pkg.go.dev]: https://pkg.go.dev/github.com/micnncim/action-label-syncer?tab=overview
[pkg.go.dev-badge]: https://img.shields.io/badge/pkg.go.dev-reference-02ABD7?style=for-the-badge&logoWidth=25&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ijg1IDU1IDEyMCAxMjAiPjxwYXRoIGZpbGw9IiMwMEFERDgiIGQ9Ik00MC4yIDEwMS4xYy0uNCAwLS41LS4yLS4zLS41bDIuMS0yLjdjLjItLjMuNy0uNSAxLjEtLjVoMzUuN2MuNCAwIC41LjMuMy42bC0xLjcgMi42Yy0uMi4zLS43LjYtMSAuNmwtMzYuMi0uM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S42LTEwLjgtMTkuMy0xLjgtMTEuMyAxLjMtMjEuMyA4LjEtMzAuMiA3LjMtOS42IDE2LjEtMTQuNiAyOC0xNi43IDEwLjItMS44IDE5LjgtLjggMjguNSA1LjEgNy45IDUuNCAxMi44IDEyLjcgMTQuMSAyMi4zIDEuNyAxMy41LTIuMiAyNC41LTExLjUgMzMuOS02LjYgNi43LTE0LjcgMTAuOS0yNCAxMi44LTIuNy41LTUuNC42LTggLjl6bTIzLjgtNDAuNGMtLjEtMS4zLS4xLTIuMy0uMy0zLjMtMS44LTkuOS0xMC45LTE1LjUtMjAuNC0xMy4zLTkuMyAyLjEtMTUuMyA4LTE3LjUgMTcuNC0xLjggNy44IDIgMTUuNyA5LjIgMTguOSA1LjUgMi40IDExIDIuMSAxNi4zLS42IDcuOS00LjEgMTIuMi0xMC41IDEyLjctMTkuMXoiLz48L3N2Zz4=
[dependabot]: https://github.com/micnncim/action-label-syncer/pulls?q=is:pr%20author:app/dependabot-preview
[dependabot-badge]: https://img.shields.io/badge/dependabot-enabled-blue?style=for-the-badge&logo=dependabot
[license]: LICENSE
[license-badge]: https://img.shields.io/github/license/micnncim/action-label-syncer?style=for-the-badge