{"id":17678101,"url":"https://github.com/babarot/github-labeler","last_synced_at":"2025-04-30T13:51:26.800Z","repository":{"id":44668328,"uuid":"158204289","full_name":"babarot/github-labeler","owner":"babarot","description":"Declarative way to configure GitHub labels","archived":false,"fork":false,"pushed_at":"2023-03-26T07:12:47.000Z","size":1976,"stargazers_count":75,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T16:39:45.080Z","etag":null,"topics":["github-actions","github-labels","go","golang","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/babarot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-11-19T10:39:26.000Z","updated_at":"2024-09-24T06:09:00.000Z","dependencies_parsed_at":"2023-09-09T05:49:42.466Z","dependency_job_id":null,"html_url":"https://github.com/babarot/github-labeler","commit_stats":null,"previous_names":["babarot/github-labeler"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fgithub-labeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fgithub-labeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fgithub-labeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fgithub-labeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babarot","download_url":"https://codeload.github.com/babarot/github-labeler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251714932,"owners_count":21631806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","github-labels","go","golang","yaml"],"created_at":"2024-10-24T08:03:46.804Z","updated_at":"2025-04-30T13:51:26.759Z","avatar_url":"https://github.com/babarot.png","language":"Go","readme":"GitHub labels as a Code!\n========================\n\n![](docs/demo.png)\n\nCLI that sets GitHub labels exactly as written in YAML file\n\n## Concepts\n\n- Create a label (e.g. when no label described in YAML)\n- Edit a label (e.g. when its color was changed)\n- Delete a label (e.g. when the label not described in YAML exists on GitHub)\n\n## YAML example\n\n```yaml\nlabels:\n  - name: kind/proactive\n    description: Categorizes issue or PR as related to proactive tasks.\n    color: 9CCC65\n  - name: kind/reactive\n    description: Categorizes issue or PR as related to reactive tasks.\n    color: FFA000\n\nrepos:\n  - name: org/repo\n    labels:\n      - kind/proactive\n      - kind/reactive\n```\n\n## Run as GitHub Actions\n\n### YAML for defined labels\n\nYou 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.\n\n\u003cdetails\u003e\u003csummary\u003e\u003ccode\u003e.github/labels.yml\u003c/code\u003e\u003c/summary\u003e\n\u003c/br\u003e\n\n```yaml\nlabels:\n- name: help wanted\n  description: Extra attention is needed\n  color: \"008672\"\n- name: bug\n  description: Something isn't working\n  color: fc2929\n- name: enhancement\n  description: New feature or request\n  color: 84b6eb\n- name: question\n  description: Further information is requested\n  color: cc317c\nrepos:\n- name: user/repo\n  labels:\n  - help wanted\n  - bug\n  - enhancement\n  - question\n```\n\n\u003c/details\u003e\n\n### YAML for workflows to sync labels between existing one and defined one\n\nThis is the one of the workflow of this app.\nIt means to do the same with GitHub Actions as running github-labeler on your local machine.\n\n\u003cdetails\u003e\u003csummary\u003e\u003ccode\u003e.github/workflows/sync_labels.yml\u003c/code\u003e\u003c/summary\u003e\n\u003c/br\u003e\n\n```yaml\nname: Sync labels\n\non:\n  push:\n    branches:\n      - master\n    paths:\n      - .github/labels.yml\n\njobs:\n  sync:\n    name: Run\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@1.0.0\n      - name: Sync labels\n        uses: b4b4r07/github-labeler@master\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n\u003c/details\u003e\n\n\u003cimg src=\"docs/ga-sync.png\" width=\"600\"\u003e\n\nIf 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](https://github.com/b4b4r07/action-github-comment) step, you can also post the github-labeler result to the GitHub comment.\n\n\u003cdetails\u003e\u003csummary\u003e\u003ccode\u003e.github/workflows/sync_labels_dryrun.yml\u003c/code\u003e\u003c/summary\u003e\n\u003c/br\u003e\n\n```yaml\nname: Sync labels\n\non: [pull_request]\n\njobs:\n  sync:\n    name: Dry run\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v1\n      - name: Sync labels with dryrun option\n        uses: b4b4r07/github-labeler@master\n        with:\n          dryrun: 'true'\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        id: labeler\n      - name: Post github-labeler command result to GitHub comment\n        uses: b4b4r07/action-github-comment@master\n        if: steps.labeler.outputs.result\n        with:\n          body: |\n            ## github-labeler result\n            ```\n            ${{ steps.labeler.outputs.result }}\n            ```\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          LOG: trace\n```\n\n\u003c/details\u003e\n\n\u003cimg src=\"docs/ga-sync-dryrun.png\" width=\"600\"\u003e\n\n\u003cimg src=\"docs/ga-sync-dryrun-result.png\" width=\"600\"\u003e\n\n### YAML for workflows to import labels from existing one to defined one\n\nThis is the workflow to import your existing labels on GitHub to the definition YAML.\nEven 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.\n\n\u003cdetails\u003e\u003csummary\u003e\u003ccode\u003e.github/workflows/import_labels.yml\u003c/code\u003e\u003c/summary\u003e\n\u003c/br\u003e\n\n```yaml\nname: Import labels\n\non:\n  label:\n    types:\n      - created\n      - edited\n      - deleted\n\njobs:\n  sync:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@1.0.0\n      - name: Import between existing labels\n        uses: b4b4r07/github-labeler@master\n        with:\n          import: 'true'\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      - name: Create Pull Request\n        uses: peter-evans/create-pull-request@v1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          commit-message: \"Import existing labels\"\n          title: \"Import existing labels\"\n          body: |\n            ## WHAT\n            This pull request was created by [create-pull-request](https://github.com/peter-evans/create-pull-request).\n            ## WHY\n            Current labels.yaml and existing labels don't match.\n          branch: import-labels\n          branch-suffix: timestamp\n```\n\n\u003c/details\u003e\n\n\u003cimg src=\"docs/ga-import.png\" width=\"600\"\u003e\n\n## Installation\n\nDownload the binary from [GitHub Releases][release] and drop it in your `$PATH`.\n\n- [Darwin / Mac][release]\n- [Linux][release]\n\n## License\n\n[MIT][license]\n\n[release]: https://github.com/b4b4r07/github-labeler/releases/latest\n[license]: https://b4b4r07.mit-license.org\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabarot%2Fgithub-labeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabarot%2Fgithub-labeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabarot%2Fgithub-labeler/lists"}