{"id":41286991,"url":"https://github.com/flugg/labelizer","last_synced_at":"2026-01-23T03:16:42.277Z","repository":{"id":39431868,"uuid":"480829224","full_name":"flugg/labelizer","owner":"flugg","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-01T04:01:02.000Z","size":1751,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-01T15:48:39.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/flugg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-12T13:46:38.000Z","updated_at":"2024-08-01T12:41:11.326Z","dependencies_parsed_at":"2023-02-17T01:30:57.209Z","dependency_job_id":null,"html_url":"https://github.com/flugg/labelizer","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"4bcea43b8f7e04357b66f8d31736c2acf8fe7a57"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flugg/labelizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flugg%2Flabelizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flugg%2Flabelizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flugg%2Flabelizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flugg%2Flabelizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flugg","download_url":"https://codeload.github.com/flugg/labelizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flugg%2Flabelizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28679142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"online","status_checked_at":"2026-01-23T02:00:08.296Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-01-23T03:16:40.335Z","updated_at":"2026-01-23T03:16:42.273Z","avatar_url":"https://github.com/flugg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi Labeler\n\n[![codecov](https://codecov.io/gh/fuxingloh/multi-labeler/branch/main/graph/badge.svg?token=SOWIV1VVM1)](https://codecov.io/gh/fuxingloh/multi-labeler)\n[![CodeFactor](https://www.codefactor.io/repository/github/fuxingloh/multi-labeler/badge)](https://www.codefactor.io/repository/github/fuxingloh/multi-labeler)\n[![Release](https://img.shields.io/github/v/release/fuxingloh/multi-labeler)](https://github.com/fuxingloh/multi-labeler/releases)\n[![License MIT](https://img.shields.io/github/license/fuxingloh/multi-labeler)](https://github.com/fuxingloh/multi-labeler/blob/main/LICENSE)\n\nMulti labeler for title, body, comments, commit messages, branch, author or files. Optionally, generate a status check\nbased on the labels.\n\n[Who is using `fuxingloh/multi-labeler`?](https://github.com/search?o=desc\u0026q=fuxingloh+%2F+multi-labeler\u0026s=indexed\u0026type=Code)\n\n## Features\n\n- Single compiled javascript file, extremely fast. Use fewer credits!\n- Append based multi-labeler, using `.github/labeler.yml` as config.\n- Automatically fail if `labeler.yml` is malformed, type-checked.\n- Set label to sync for conditional labeling, removed if condition failed.\n- Regex Matcher:\n  - PR/Issue title\n  - PR/Issue body\n  - PR/Issue comments\n  - PR commit messages\n  - PR branch name\n- File Matcher:\n  - Files count\n  - Files any glob match\n  - Files all glob match\n- Author Matcher\n- Generate status checks:\n  - Any label match\n  - All label match\n\n## Usage\n\n#### `.github/workflow/labeler.yml`\n\n```yml\non:\n  pull_request_target: # for OSS with public contributions (forked PR)   \n  pull_request:\n  # Useful for triaging code review, and generate compliance status check.\n  # Semantic release? Done.\n  # Make a file change in a mono repo. Tag the mono repo getting changed to generate better release!\n\n  issues:\n  # Useful for triaging error!\n  # '- [x] Is this a bug?' = 'bug' label!\n\n  issue_comment:\n  # To pickup comment body in pr or issue and generate a label. \n  # Imagine someone comment 'Me too, I get TimeoutException from ...' in comment body. \n  # Generate a 'bug/timeout' label for better triaging!\n\npermissions:\n  # Setting up permissions in the workflow to limit the scope of what it can do. Optional!\n  contents: read\n  issues: write\n  pull-requests: write\n  statuses: write\n  checks: write\n\njobs:\n  labeler:\n    name: Labeler\n    runs-on: ubuntu-latest\n    steps:\n      # follows semantic versioning. Lock to different version: v1, v1.5, v1.5.0 or use a commit hash.\n      - uses: fuxingloh/multi-labeler@v1\n        with:\n          github-token: ${{secrets.GITHUB_TOKEN}} # optional, default to '${{ github.token }}'  \n          config-path: .github/labeler.yml # optional, default to '.github/labeler.yml'\n```\n\n#### `.github/labeler.yml`\n\n```yml\n# .github/labeler.yml\n\nversion: v1\n\nlabels:\n  - label: \"feat\"\n    sync: true # remove label if match failed, default: false (pull_request/issue only)\n    matcher:\n      # Matcher will match on any 7 matcher\n      title: \"^feat:.*\"\n      body: \"/feat\"\n      comment: \"/feat\"\n      branch: \"^feat/.*\"\n      commits: \"^feat:.*\"\n      author:\n        - github-actions\n        - fuxingloh\n      files:\n        any: [ \"app/*\" ]\n        all: [ \"!app/config/**\" ]\n        count:\n          gte: 1\n          lte: 1000\n\n# Optional, if you want labels to generate a success/failure status check\nchecks:\n  - context: \"Status Check\"\n    url: \"https://go.to/detail\"\n    description:\n      success: \"Ready for review \u0026 merge.\"\n      failure: \"Missing labels for release.\"\n    labels:\n      any:\n        - any\n        - have\n      all:\n        - all\n        - must\n        - have\n```\n\n### Examples\n\n\u003cdetails\u003e\n  \u003csummary\u003eSemantic Pull Request\u003c/summary\u003e\n\n#### `.github/workflow/pr-triage.yml`\n\n```yml\non:\n  pull_request:\n    types: [ opened, edited, synchronize, ready_for_review ]\n    branches: [ master, main ]\n\njobs:\n  labeler:\n    name: Labeler\n    runs-on: ubuntu-latest\n    steps:\n      - uses: fuxingloh/multi-labeler@v1\n```\n\n#### `.github/labeler.yml`\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"feat\"\n    matcher:\n      title: \"^feat: .*\"\n      commits: \"^feat: .*\"\n\n  - label: \"fix\"\n    matcher:\n      title: \"^fix: .*\"\n      commits: \"^fix: .*\"\n\n  - label: \"chore\"\n    matcher:\n      title: \"^chore: .*\"\n      commits: \"^chore: .*\"\n\n  - label: \"docs\"\n    matcher:\n      title: \"^docs: .*\"\n      commits: \"^docs: .*\"\n\nchecks:\n  - context: \"Semantic Pull Request\"\n    url: \"https://github.com/fuxingloh/multi-labeler/blob/main/.github/labeler.yml\"\n    description:\n      success: Ready for review \u0026 merge.\n      failure: Missing semantic label for merge.\n    labels:\n      any:\n        - feat\n        - fix\n        - chore\n        - docs\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ePR Triage\u003c/summary\u003e\n\n#### `.github/workflow/pr-triage.yml`\n\n```yml\non:\n  pull_request:\n    types: [ opened, edited, synchronize, ready_for_review ]\n    branches: [ master, main ]\n\njobs:\n  labeler:\n    name: Labeler\n    runs-on: ubuntu-latest\n    steps:\n      - uses: fuxingloh/multi-labeler@v1\n```\n\n#### `.github/labeler.yml`\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"feat\"\n    matcher:\n      title: \"^feat:.*\"\n      branch: \"^feat/.*\"\n      commits: \"^feat:.*\"\n\n  - label: \"fix\"\n    matcher:\n      title: \"^fix:.*\"\n      branch: \"^fix/.*\"\n      commits: \"^fix:.*\"\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eIssue Triage\u003c/summary\u003e\n\n#### `.github/workflow/issue-triage.yml`\n\n```yml\non:\n  issues:\n    types: [ opened, edited ]\n\njobs:\n  labeler:\n    name: Labeler\n    runs-on: ubuntu-latest\n    steps:\n      - uses: fuxingloh/multi-labeler@v1\n```\n\n#### `.github/labeler.yml`\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"bug\"\n    matcher:\n      body: \"(\\\\n|.)*- \\\\[x\\\\] bug(\\\\n|.)*\"\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eComment Triage\u003c/summary\u003e\n\n#### `.github/workflow/comment-slash.yml`\n\n```yml\non:\n  issue_comment:\n    types: [ created, edited ]\n\njobs:\n  labeler:\n    name: Labeler\n    runs-on: ubuntu-latest\n    steps:\n      - uses: fuxingloh/multi-labeler@v1\n```\n\n#### `.github/labeler.yml`\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"coverage\"\n    matcher:\n      comment: \"# \\\\[Codecov\\\\] .*\"\n\n  - label: \"stale\"\n    matcher:\n      comment: \"/stale\"\n```\n\n\u003c/details\u003e\n\n## Configuration\n\nOnce you’ve added multi-labeler to your repository, it must be enabled by adding a `.github/labeler.yml` configuration\nfile to the repository.\n\n## Matchers\n\n\u003e RegEx matcher requires backslash '\\' to be double slashed '\\\\'. Hence, to match brackets '()' you need a regex of '\\\\(\\\\)'. See https://github.com/fuxingloh/multi-labeler/issues/103\n\n### PR/Issue Title: RegEx\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"feat\"\n    matcher:\n      title: \"^feat:.*\"\n```\n\n### PR/Issue Body: RegEx\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"bug\"\n    matcher:\n      # e.g. '- [x] bug'\n      body: \"(\\\\n|.)*- \\\\[x\\\\] bug(\\\\n|.)*\"\n```\n\n### PR/Issue Comment: RegEx\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"stale\"\n    matcher:\n      comment: \"/stale\"\n```\n\n### PR Branch: RegEx\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"feat\"\n    matcher:\n      branch: \"^feat/.*\"\n```\n\n### PR Commits: RegEx\n\nCheck all commits and find any match, max of 250 commits only.\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"feat\"\n    matcher:\n      commits: \"^feat: .*\"\n```\n\n### PR/Issue Author\n\nCheck for pr or issue author match.\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"single\"\n    matcher:\n      author: \"fuxingloh\"\n  - label: \"any\"\n    matcher:\n      author:\n        - adam\n        - claire\n```\n\n### PR Files: [Glob Matcher](https://github.com/isaacs/minimatch)\n\nMaximum of 3000 files only. If you use this to audit changes, take note of the 3000 files limitation. Matcher within\nfiles are 'and condition', all must match.\n\n#### PR Files Basic\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"github\"\n    sync: true\n    matcher:\n      # This is shorthand for any: [\".github/**\"]\n      files: \".github/**\"\n\n  - label: \"security\"\n    sync: true\n    matcher:\n      # This is shorthand for any: [\"web/security/**\", \"security/**\"]\n      files: [ \"web/security/**\", \"security/**\" ]\n```\n\n#### PR Files Count\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"size: s\"\n    sync: true\n    matcher:\n      files:\n        count:\n          gte: 1\n          lte: 4\n\n  - label: \"size: m\"\n    sync: true\n    matcher:\n      files:\n        count:\n          gte: 5\n          lte: 10\n\n  - label: \"size: l\"\n    sync: true\n    matcher:\n      files:\n        count:\n          gte: 11\n```\n\n#### PR Files Any \u0026 All\n\n```yml\nversion: v1\n\nlabels:\n  - label: \"ci\"\n    sync: true\n    matcher:\n      files:\n        any: [ \".github/workflow/**\", \".circleci/**\" ]\n        all: [ \"!app/**\" ]\n\n  - label: \"attention\"\n    sync: true\n    matcher:\n      files:\n        any: [ \"app/**\" ]\n        count:\n          neq: 1\n```\n\n### PR Status Checks\n\n#### PR Check any\n\n```yml\nversion: v1\n\nchecks:\n  - context: \"Release Drafter\"\n    url: \"https://go.to/detail\"\n    description:\n      success: \"Ready for review \u0026 merge.\"\n      failure: \"Missing labels for release.\"\n    labels:\n      any:\n        - feat\n        - fix\n        - chore\n        - docs \n```\n\n#### PR Check any + all\n\n```yml\nversion: v1\n\nchecks:\n  - context: \"Merge check\"\n    description: \"Labels for merge.\"\n    labels:\n      any: [ \"reviewed\", \"size:s\" ]\n      all: [ \"app\" ]\n```\n\n#### PR Check none\n\n```yml\nversion: v1\n\nchecks:\n  - context: \"Merge check\"\n    description: \"Disable merging when 'DO NOT MERGE' label is set\"\n    labels:\n      none: [ \"DO NOT MERGE\" ]\n```\n\n## Why?\n\n\u003e There are so many labeler why create another? 😧\n\n1. I want a lightweight labeler that is written in TypeScript so that it don't have to build a docker image everytime it  runs.\n2. I want a simple match first append based multi-labeler without it being a turing complete solution.\n3. I want to write my rules with `.github/labeler.yml` for a single source of label truth.\n4. I don't want it to do anything else, labels only.\n   1. Assume you are using GitHub branch protection (labels only).\n   2. I want to run this in PR triage before everything else (labels only).\n   3. Chain this action with another action; this should just be for (labels only). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflugg%2Flabelizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflugg%2Flabelizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflugg%2Flabelizer/lists"}