{"id":18083153,"url":"https://github.com/ivanfon/super-labeler-action","last_synced_at":"2025-04-12T17:13:31.949Z","repository":{"id":47682778,"uuid":"247311737","full_name":"IvanFon/super-labeler-action","owner":"IvanFon","description":"A superpowered issue and pull request labeler for Github Actions.","archived":false,"fork":false,"pushed_at":"2023-05-31T20:43:32.000Z","size":522,"stargazers_count":23,"open_issues_count":16,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T17:13:24.855Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IvanFon.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-14T16:24:50.000Z","updated_at":"2025-03-04T09:41:36.000Z","dependencies_parsed_at":"2024-06-19T06:29:45.379Z","dependency_job_id":null,"html_url":"https://github.com/IvanFon/super-labeler-action","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":0.05714285714285716,"last_synced_commit":"84807c8cbd8551033de8d484c7ba5e6430ed3604"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanFon%2Fsuper-labeler-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanFon%2Fsuper-labeler-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanFon%2Fsuper-labeler-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanFon%2Fsuper-labeler-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IvanFon","download_url":"https://codeload.github.com/IvanFon/super-labeler-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602311,"owners_count":21131616,"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":[],"created_at":"2024-10-31T14:07:04.841Z","updated_at":"2025-04-12T17:13:31.933Z","avatar_url":"https://github.com/IvanFon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# super-labeler-action\n\n**This action already has the features and stability for the original use case I wrote it for, and I'm not looking to add to it at this time. If you're looking for additional features, there's an active fork at [videndum/super-labeler-action](https://github.com/videndum/super-labeler-action).**\n\nA superpowered issue and pull request labeler for Github Actions.\n\nSuper Labeler allows you to declaratively define your repository's labels, and when to apply them, in a config file that's checked into your repository.\n\n## Getting Started\n\nCreate a new Github Actions workflow at `.github/workflows/label.yml`:\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eClick to show example workflow\u003c/b\u003e\u003c/summary\u003e\n\n_Note: `actions/checkout` must be run first so that the labeler action can find your config file._\n\n```yaml\non:\n  issues: [opened, edited, closed, reopened]\n  pull_request:\n    types: [opened, edited, closed, reopened, ready_for_review, synchronize]\n\njobs:\n  label:\n    runs-on: ubuntu-latest\n    name: Label issues and pull requests\n    steps:\n      - uses: actions/checkout@v2\n      - uses: IvanFon/super-labeler-action@v1\n        with:\n          github-token: '${{ secrets.GITHUB_TOKEN }}'\n```\n\n\u003c/details\u003e\n\nNow create the labeler config file at `.github/labels.json`:\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eClick here to show example config\u003c/b\u003e\u003c/summary\u003e\n\n```json\n{\n  \"labels\": {\n    \"example\": {\n      \"name\": \"example\",\n      \"colour\": \"#00ff00\",\n      \"description\": \"Example label\"\n    }\n  },\n  \"issue\": {\n    \"example\": {\n      \"requires\": 2,\n      \"conditions\": [\n        {\n          \"type\": \"titleMatches\",\n          \"pattern\": \"example\"\n        },\n        {\n          \"type\": \"isOpen\"\n        }\n      ]\n    }\n  },\n  \"pr\": {\n    \"example\": {\n      \"requires\": 1,\n      \"conditions\": [\n        {\n          \"type\": \"isDraft\",\n          \"value\": false\n        }\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\nBe sure that Github Actions is enabled for in your repository's settings. Super Labeler will now run on your issues and pull requests.\n\n## Index\n\n- [Getting Started](#getting-started)\n- [Index](#index)\n- [How it Works](#how-it-works)\n- [Config File Format](#config-file-format)\n- [Using Regex Patterns](#using-regex-patterns)\n- [Available Conditions](#available-conditions)\n  - [branchMatches](#branchmatches)\n  - [creatorMatches](#creatormatches)\n  - [descriptionMatches](#descriptionmatches)\n  - [filesMatch](#filesmatch)\n  - [isDraft](#isdraft)\n  - [isLocked](#islocked)\n  - [isOpen](#isopen)\n  - [titleMatches](#titlematches)\n\n## How it Works\n\nWhenever Super Labeler runs, it will first add and update your repository's labels to match your config. Then it will go through each label's conditions to determine if it should apply or remove that label.\n\nEach label has a list of conditions that must be met for it to be applied. You must specify the minimum number of conditions that must be met for the label to be applied.\n\nEach label has a key, which can be different from it's name. This key should be in plaintext, and will be used to refer to the given label when defining your conditions. For example, given the following labels definition:\n\n```json\n{\n  \"labels\": {\n    \"bugfix\": {\n      \"name\": \"Bugfix! 🎉\",\n      \"colour\": \"ff0000\",\n      \"description\": \"Fixes a bug.\"\n    }\n  }\n}\n```\n\nWhile the label's name, which will be displayed on Github, is \"Bugfix! 🎉\", to be able to easily refer to it from our conditions, we would use it's key, which is just `bugfix`:\n\n```json\n{\n  \"pr\": {\n    \"bugfix\": {\n      \"requires\": 1,\n      \"conditions\": [\n        {\n          \"type\": \"branchMatches\",\n          \"pattern\": \"^bugfix\"\n        }\n      ]\n    }\n  }\n}\n```\n\n## Config File Format\n\nThe config object contains three keys:\n\n- `labels`: Your repository's labels, which will be automatically created and updated by Super Labeler\n- `issue`: Labels to apply to issues, and their conditions\n- `pr`: Labels to apply to pull requests, and their conditions\n\nTake a look at the examples in this file to get a feel for how to configure it. The below Typescript interface, which is used by this action, may also be helpful:\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eClick to show Typescript config interface\u003c/b\u003e\u003c/summary\u003e\n\n```js\ninterface Config {\n  labels: {\n    [key: string]: {\n      name: string,\n      colour: string,\n      description: string,\n    },\n  };\n  issue: {\n    [key: string]: {\n      requires: number,\n      conditions: IssueCondition[],\n    },\n  };\n  pr: {\n    [key: string]: {\n      requires: number,\n      conditions: PRCondition[],\n    },\n  };\n}\n```\n\n\u003c/details\u003e\n\n## Using Regex Patterns\n\nMany conditions use regular expressions (usually with a `pattern` parameter).\nSince these regular expressions are passed in through JSON strings, there are\nsome things to pay attention to.\n\nSpecial characters must be double escaped: `pattern: \"\\\\W+$\"` is equivalent to the Regex: `/\\W+$/`.\n\nIf you want to use flags, use the following format: `pattern: \"/^wip:/i\"` is equivalent to the Regex: `/^wip:/i`.\n\n## Available Conditions\n\n### branchMatches\n\n**Applies to: pull requests**\n\nChecks if branch name matches a Regex pattern.\n\nExample:\n\n```json\n{\n  \"type\": \"branchMatches\",\n  \"pattern\": \"^bugfix\\\\/\"\n}\n```\n\n### creatorMatches\n\n**Applies to: issues and pull requests**\n\nChecks if an issue or pull request's creator's username matches a Regex pattern.\n\nExample:\n\n```json\n{\n  \"type\": \"creatorMatches\",\n  \"pattern\": \"^foo\"\n}\n```\n\n### descriptionMatches\n\n**Applies to: issues and pull requests**\n\nChecks if an issue or pull request's description matches a Regex pattern.\n\nExample:\n\n```json\n{\n  \"type\": \"descriptionMatches\",\n  \"pattern\": \"foo.*bar\"\n}\n```\n\n### filesMatch\n\n**Applies to: pull requests**\n\nChecks if the files modified in the pull request match a glob.\n\nGlobs are matched using the [minimatch](https://github.com/isaacs/minimatch) library.\n\nExample:\n\n```json\n{\n  \"type\": \"filesMatch\",\n  \"glob\": \"src/foo/**/*\"\n}\n```\n\n### isDraft\n\n**Applies to: pull requests**\n\nChecks if a pull request is a draft.\n\nExample:\n\n```json\n{\n  \"type\": \"isDraft\",\n  \"value\": true\n}\n```\n\n### isLocked\n\n**Applies to: issues and pull requests**\n\nChecks if an issue or pull request is locked.\n\nExample:\n\n```json\n{\n  \"type\": \"isLocked\",\n  \"value\": true\n}\n```\n\n### isOpen\n\n**Applies to: issues and pull requests**\n\nChecks if an issue or pull request is open or closed.\n\nExample:\n\n```json\n{\n  \"type\": \"isOpen\",\n  \"value\": true\n}\n```\n\n### titleMatches\n\n**Applies to: issues and pull requests**\n\nChecks if an issue or pull request's title matches a Regex pattern.\n\nExample:\n\n```json\n{\n  \"type\": \"titleMatches\",\n  \"pattern\": \"/^wip:/i\"\n}\n```\n\n---\n\n[back to top](#super-labeler-action)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanfon%2Fsuper-labeler-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanfon%2Fsuper-labeler-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanfon%2Fsuper-labeler-action/lists"}