{"id":22128620,"url":"https://github.com/redhat-plumbers-in-action/advanced-issue-labeler","last_synced_at":"2025-07-25T18:31:38.843Z","repository":{"id":37718720,"uuid":"501288664","full_name":"redhat-plumbers-in-action/advanced-issue-labeler","owner":"redhat-plumbers-in-action","description":"🔖 Label issues based on input and defined policy","archived":false,"fork":false,"pushed_at":"2024-11-01T13:11:22.000Z","size":22101,"stargazers_count":16,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-29T19:36:56.903Z","etag":null,"topics":["github-action","issue-forms","labels","policy-based-labeling","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-plumbers-in-action.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-08T14:34:58.000Z","updated_at":"2024-11-01T13:11:18.000Z","dependencies_parsed_at":"2023-09-28T03:53:55.366Z","dependency_job_id":"5f2192d7-e9f5-49f9-a2fd-fb729475cc80","html_url":"https://github.com/redhat-plumbers-in-action/advanced-issue-labeler","commit_stats":{"total_commits":329,"total_committers":3,"mean_commits":"109.66666666666667","dds":0.4164133738601824,"last_synced_commit":"1ac30a463570d1f1e7417beedc427483877de47d"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fadvanced-issue-labeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fadvanced-issue-labeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fadvanced-issue-labeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fadvanced-issue-labeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-plumbers-in-action","download_url":"https://codeload.github.com/redhat-plumbers-in-action/advanced-issue-labeler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227606213,"owners_count":17792786,"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-action","issue-forms","labels","policy-based-labeling","typescript"],"created_at":"2024-12-01T17:46:19.141Z","updated_at":"2025-07-25T18:31:38.827Z","avatar_url":"https://github.com/redhat-plumbers-in-action.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/redhat-plumbers-in-action/team/blob/70f67465cc46e02febb16aaa1cace2ceb82e6e5c/members/pink-plumber.png\" width=\"100\" /\u003e\n  \u003ch1 align=\"center\"\u003eAdvanced Issue Labeler\u003c/h1\u003e\n\u003c/p\u003e\n\n[![GitHub Marketplace][market-status]][market] [![Lint Code Base][linter-status]][linter] [![Unit Tests][test-status]][test] [![CodeQL][codeql-status]][codeql] [![Check dist/][check-dist-status]][check-dist]\n\n[![Demo][demo-status]][demo] [![codecov][codecov-status]][codecov]\n\n\u003c!-- Status links --\u003e\n\n[market]: https://github.com/marketplace/actions/advanced-issue-labeler\n[market-status]: https://img.shields.io/badge/Marketplace-Advanced%20Issue%20Labeler-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=\n\n[linter]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/lint.yml\n[linter-status]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/lint.yml/badge.svg\n\n[test]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/unit-tests.yml\n[test-status]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/unit-tests.yml/badge.svg\n\n[codeql]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/codeql-analysis.yml\n[codeql-status]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/codeql-analysis.yml/badge.svg\n\n[check-dist]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/check-dist.yml\n[check-dist-status]: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/actions/workflows/check-dist.yml/badge.svg\n\n[demo]: https://github.com/redhat-plumbers-in-action/issue-forms-automation/issues/new/choose\n[demo-status]: https://img.shields.io/badge/Demo-Issue%20Forms%20Automation-blue\n\n[codecov]: https://codecov.io/gh/redhat-plumbers-in-action/advanced-issue-labeler\n[codecov-status]: https://codecov.io/gh/redhat-plumbers-in-action/advanced-issue-labeler/branch/main/graph/badge.svg\n\n\u003c!-- --\u003e\n\nAdvanced Issue Labeler is a GitHub Action that can automatically label issues based on user input. The idea for this project came from and was first introduced in [@systemd/systemd](https://github.com/systemd/systemd). Systemd repository has a very active community with many issues to process. Automatic labeling helps with issue triaging.\n\n## How does it work\n\nAdvanced Issue Labeler takes advantage of GitHub [issue forms](https://github.blog/changelog/2021-06-23-issues-forms-beta-for-public-repositories) (special kind of issue templates) to provide a better developer experience by labeling issues based on provided input. This action works best with [`dropdowns`](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#dropdown) and [`checkboxes`](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#checkboxes).\n\nAdvanced Issue Labeler is expected to work in cooperation with [@stefanbuck/github-issue-parser `\u003e= v3.1.1`](https://github.com/stefanbuck/github-issue-parser) GitHub Action. Parser action provides JSON representation of the submitted issue, where KEYs represent IDs described in the issue-form YAML configuration. Issue labeler understands it and can label issues based on selected values from dropdown. Dropdown values could directly represent labels or be mapped to policy configuration for more complex labeling requirements.\n\n## Features\n\n* Ability to label issues based on issue form `dropdowns` and `checkboxes`\n* Ability to specify [policy](#policy) for mapping specific keywords to labels\n* Ability to exclude certain words from the labeling process ([`block-list`](#block-list))\n* Ability to define multiple policies for different issue forms\n\n## Usage\n\n### 1. Simple usecase\n\nThe following example shows how to automatically label issues based on the severity that the user describes in issue form. In issue form, there is a defined dropdown listing all severity levels:\n\n```yml\n# ...\n\n- type: dropdown\n  id: severity\n  attributes:\n    label: Severity impact\n    description: Please choose the severity of the impact of this issue.\n    multiple: false\n    options:\n      - 'None'\n      - 'Low'\n      - 'Medium'\n      - 'High'\n      - 'Urgent'\n      - 'Other'\n  validations:\n    required: true\n\n# ...\n```\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e It's essential to set the correct ID in issue-form\n\nGitHub workflow that automatically marks issues with severity labels:\n\n```yml\nname: Issue labeler\non:\n  issues:\n    types: [ opened ]\n\npermissions:\n  contents: read\n\njobs:\n  label-component:\n    runs-on: ubuntu-latest\n\n    permissions:\n      # required for all workflows\n      issues: write\n\n      # only required for workflows in private repositories\n      actions: read\n      contents: read\n\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Parse issue form\n        uses: stefanbuck/github-issue-parser@v3\n        id: issue-parser\n        with:\n          template-path: .github/ISSUE_TEMPLATE/bug.yml\n\n      - name: Set labels based on severity field\n        uses: redhat-plumbers-in-action/advanced-issue-labeler@v2\n        with:\n          issue-form: ${{ steps.issue-parser.outputs.jsonString }}\n          section: severity\n          block-list: |\n            None\n            Other\n          token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### 2. More complex usecase\n\nThe following example shows how to automatically label issues based on animal types. In issue form, there is a defined dropdown listing all animals:\n\n```yml\n# ...\n\n- type: dropdown\n  id: animals\n  attributes:\n    label: Animals\n    description: Please pick all animals you like.\n    multiple: true\n    options:\n      - 'None'\n      - '🦍 Gorilla'\n      - '🐶 Dog'\n      - '🐺 Wolf'\n      - '🦊 Fox'\n      - '🐴 Horse'\n      - '🐓 Rooster'\n      - '🐦 Bird'\n      - '🐧 Penguin'\n      - '🐸 Frog'\n      - '🐬 Dolphin'\n      - '🐡 Blowfish'\n      - '🐟 Fish'\n      - '🦈 Shark'\n      - '🐛 Bug'\n      - '🕷️ Spider'\n      - '🐊 Crocodile'\n      - 'Other'\n  validations:\n    required: true\n\n# ...\n```\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e It's essential to set the correct ID in issue-form\n\nLet's define a policy that will allow us to map animals to their types. Policy needs to be stored in `.github/advanced-issue-labeler.yml`.\n\n```yml\npolicy:\n  - section:\n      - id: [animals]\n        block-list: ['None', 'Other']\n        label:\n          - name: 'kind: amphibians'\n            keys: ['🐸 Frog']\n          - name: 'kind: birds'\n            keys: ['🐓 Rooster', '🐦 Bird', '🐧 Penguin']\n          - name: 'kind: fish'\n            keys: ['🐡 Blowfish', '🐟 Fish', '🦈 Shark']\n          - name: 'kind: mammals'\n            keys: ['🦍 Gorilla', '🐶 Dog', '🐬 Dolphin', '🐺 Wolf', '🦊 Fox', '🐴 Horse']\n          - name: 'kind: reptiles'\n            keys: ['🐊 Crocodile']\n          - name: 'invertebrates'\n            keys: ['🐛 Bug', '🕷️ Spider']\n```\n\nGitHub workflow that automatically marks issues with animal types labels:\n\n```yml\nname: Issue labeler\non:\n  issues:\n    types: [ opened ]\n\npermissions:\n  contents: read\n\njobs:\n  label-component:\n    runs-on: ubuntu-latest\n\n    permissions:\n      # required for all workflows\n      issues: write\n\n      # only required for workflows in private repositories\n      actions: read\n      contents: read\n\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Parse issue form\n        uses: stefanbuck/github-issue-parser@v3\n        id: issue-parser\n        with:\n          template-path: .github/ISSUE_TEMPLATE/bug.yml\n\n      - name: Set labels based on animals field\n        uses: redhat-plumbers-in-action/advanced-issue-labeler@v2\n        with:\n          issue-form: ${{ steps.issue-parser.outputs.jsonString }}\n          token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### Real-life examples\n* [`zen-browser/desktop`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/zen-browser/desktop%24+file:%5E%5C.github/workflows+redhat-plumbers-in-action/advanced-issue-labeler\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/zen-browser/desktop?style=social)](https://github.com/zen-browser/desktop)\n\n* [`SeleniumHQ/selenium`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/SeleniumHQ/selenium%24+file:%5E%5C.github/workflows+redhat-plumbers-in-action/advanced-issue-labeler\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/SeleniumHQ/selenium?style=social)](https://github.com/SeleniumHQ/selenium)\n\n* [`backstage/backstage`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/backstage/backstage%24+file:%5E%5C.github/workflows+redhat-plumbers-in-action/advanced-issue-labeler\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/backstage/backstage?style=social)](https://github.com/backstage/backstage)\n\n* [`Lightning-AI/pytorch-lightning`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/Lightning-AI/pytorch-lightning%24+file:%5E%5C.github/workflows+redhat-plumbers-in-action/advanced-issue-labeler\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/Lightning-AI/pytorch-lightning?style=social)](https://github.com/Lightning-AI/pytorch-lightning)\n\n* [`DevToys-app/DevToys`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/DevToys-app/DevToys%24+file:%5E%5C.github/workflows+redhat-plumbers-in-action/advanced-issue-labeler\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/DevToys-app/DevToys?style=social)](https://github.com/DevToys-app/DevToys)\n\n* [`RSSNext/Folo`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/RSSNext/Folo%24+file:%5E%5C.github/workflows+redhat-plumbers-in-action/advanced-issue-labeler\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/RSSNext/Folo?style=social)](https://github.com/RSSNext/Folo)\n\n* [`bazelbuild/bazel`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/bazelbuild/bazel%24+file:%5E%5C.github/workflows+redhat-plumbers-in-action/advanced-issue-labeler\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/bazelbuild/bazel?style=social)](https://github.com/bazelbuild/bazel)\n\n* more examples - [here](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/network/dependents)\n\nFeel free to try `advanced-issue-labeler` in template repository - [`@redhat-plumbers-in-action/issue-forms-automation`](https://github.com/redhat-plumbers-in-action/issue-forms-automation)\n\n## Configuration options\n\nAction currently accepts the following options:\n\n```yml\n# ...\n\n- uses: redhat-plumbers-in-action/advanced-issue-labeler@v2\n  with:\n    issue-form:   \u003cissue-form.json\u003e\n    template:     \u003ctemplate-name.yml\u003e\n    section:      \u003csection-id\u003e\n    block-list:   \u003cblock-list\u003e\n    config-path:  \u003cpath to config file\u003e\n    token:        \u003cGitHub token\u003e\n\n# ...\n```\n\n### issue-form\n\nIssue-form parsed into `JSON` file. Supported format is generated using [@stefanbuck/github-issue-parser](https://github.com/stefanbuck/github-issue-parser) GitHub action.\n\n* default value: `undefined`\n* requirements: `required`\n\n### template\n\nEach issue form can have a defined different labeling policy, and this option is used to specify which policy should be used.\n\n* default value: `undefined`\n* requirements: `optional`\n\n### section\n\nThe ID of the section (`dropdown` or `checkboxes` section is recomended) from the issue form template.\n\n* default value: `undefined`\n* requirements: `required`\n\n### block-list\n\nList of forbidden labels. These labels won't be set.\n\n* default value: `undefined`\n* requirements: `optional`\n\n\u003e [!TIP]\n\u003e\n\u003e _Please notice the `|` in the example above ☝️. That lets you effectively declare a multi-line YAML string. You can learn more about multi-line YAML syntax [here](https://yaml-multiline.info). This syntax is required when block-listing multiple labels._\n\n### config-path\n\nPath to configuration file. Configuration file format is described in: [Policy section](#policy).\n\n* default value: `.github/advanced-issue-labeler.yml`\n* requirements: `optional`\n\n### token\n\nToken used to set labels\n\n* default value: `undefined`\n* requirements: `required`\n* recomended value: `secrets.GITHUB_TOKEN`\n\n## Outputs\n\n### labels\n\nList of labels that were set based on the provided policy. The output is a stringified JSON array.\n\n\u003e [!TIP]\n\u003e\n\u003e Use [`fromJSON`](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson) function to parse the output to get an array of labels.\n\u003e\n\u003e ```yml\n\u003e element: ${{ fromJSON(steps.\u003cstep-id\u003e.outputs.labels)[0] }}\n\u003e ```\n\n### policy\n\nThe representation of the policy that was used to set labels. The output is a stringified JSON object.\n\nExample output in JSON format where:\n\n* `template` - the name of the template that was used to parse the issue form\n* `section` - key-value pairs where the key is the ID of the issue-form section and the value is an array of the applied labels for the given section\n\n```json\n{\n  \"template\": \"bug.yml\",\n  \"section\": {\n    \"severity\": [ \"low\" ],\n    \"priority\": [ \"high\" ]\n  }\n}\n```\n\n\u003e [!TIP]\n\u003e\n\u003e Use [`fromJSON`](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson) function to parse the output to get an object of policy.\n\u003e\n\u003e ```yml\n\u003e severity: ${{ fromJSON(steps.\u003cstep-id\u003e.outputs.policy).section.severity }}\n\u003e ```\n\n## Policy\n\nIt's possible to define a labeling policy to further customize the labeling process. The policy can be defined using `.github/advanced-issue-labeler.yml` configuration file. The structure needs to be as follows:\n\n```yml\npolicy:\n  - template: ['bug.yml', 'feature.yml']\n    section:\n      - id: ['severity', 'priority']\n        block-list: []\n        label:\n          - name: 'Low'\n            keys: ['Low', 'None']\n          - name: 'Medium'\n            keys: ['Medium']\n          - name: 'High'\n            keys: ['High']\n          - name: 'Urgent'\n            keys: ['Urgent']\n      - id: [animals]\n        block-list: ['None', 'Other']\n        label:\n          - name: 'amphibians'\n            keys: ['🐸 Frog']\n          - name: 'birds'\n            keys: ['🐓 Rooster', '🐦 Bird', '🐧 Penguin']\n          - name: 'fish'\n            keys: ['🐡 Blowfish', '🐟 Fish', '🦈 Shark']\n          - name: 'mammals'\n            keys: ['🦍 Gorilla', '🐶 Dog', '🐬 Dolphin', '🐺 Wolf', '🦊 Fox', '🐴 Horse']\n          - name: 'reptiles'\n            keys: ['🐊 Crocodile']\n          - name: 'invertebrates'\n            keys: ['🐛 Bug', '🕷️ Spider']\n# - template: ...\n```\n\n### `template` keyword\n\nArray of issue-forms (e.g. `['bug-report.yml']`). This section is used to determine the correct labeling policy when multiple policies are defined. Works in cooperation with [template option](#template).\n\n* requirements: `optional`\n\n### `section.id` keyword\n\nEquivalent of [section](#section) option. An array of IDs of section from issue-form. These IDs need to point to section in the issue-form template.\n\n* requirements: `required`\n\n### `section.block-list` keyword\n\nEquivalent of [block-list](#block-list) option. An array of forbidden keywords. These keywords will be excluded when applying labeling policy.\n\n* requirements: `required`\n\n### `section.label` keyword\n\nSection of policy describing labeling policy. `label` section of the policy is expected to have the following properties:\n\n* `name` - Name of label\n* `keys` - Array of keywords corresponding to values from `issue-form` section\n\n* requirements: `required`\n\n## Limitations\n\n* Currently it's not possible to use strings containing `,␣` in the dropdown menu or checkboxes value. This pattern is used in the separation process (e.g. when the dropdown option `multiple` is set to `true`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-plumbers-in-action%2Fadvanced-issue-labeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-plumbers-in-action%2Fadvanced-issue-labeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-plumbers-in-action%2Fadvanced-issue-labeler/lists"}