{"id":26278518,"url":"https://github.com/ffittschen/pr-branch-labeler","last_synced_at":"2025-05-07T00:43:01.752Z","repository":{"id":40735674,"uuid":"206625207","full_name":"ffittschen/pr-branch-labeler","owner":"ffittschen","description":"🏷 Automatically label your PRs based on their branches.","archived":false,"fork":false,"pushed_at":"2023-02-28T14:14:20.000Z","size":976,"stargazers_count":18,"open_issues_count":11,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T15:40:35.211Z","etag":null,"topics":["branch","github-actions","javascript-action","jest","label","pull-request","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/ffittschen.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":"2019-09-05T17:53:35.000Z","updated_at":"2024-11-15T06:23:07.000Z","dependencies_parsed_at":"2024-10-25T05:27:20.521Z","dependency_job_id":null,"html_url":"https://github.com/ffittschen/pr-branch-labeler","commit_stats":{"total_commits":59,"total_committers":5,"mean_commits":11.8,"dds":0.6271186440677966,"last_synced_commit":"fb82ac8ee94d19a8b183938ffca89f6c4031d10c"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffittschen%2Fpr-branch-labeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffittschen%2Fpr-branch-labeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffittschen%2Fpr-branch-labeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffittschen%2Fpr-branch-labeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ffittschen","download_url":"https://codeload.github.com/ffittschen/pr-branch-labeler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243581092,"owners_count":20314167,"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":["branch","github-actions","javascript-action","jest","label","pull-request","typescript"],"created_at":"2025-03-14T13:16:12.588Z","updated_at":"2025-03-14T13:16:13.776Z","avatar_url":"https://github.com/ffittschen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PR Branch Labeler\n\nA GitHub Action that offers an easy way to automatically add labels to opened PRs depending on their `head` and/or `base` branch.\nThe branches can be specified directly or using patterns, such as `feature/*` or `bugfix/*`.\n\n## Usage\n\nTo use the PR Branch Labeler, you can add a YAML-based workflow file, e.g.`.github/workflows/pr-branch-labeler.yml`, with the following content:\n\n```yaml\nname: PR Branch Labeler\n\non: pull_request\n\njobs:\n  label_prs:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Label PRs\n      if: github.event.action == 'opened' # Only run the action when the PR was first opened\n      uses: ffittschen/pr-branch-labeler@v1\n      with:\n        repo-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n*Warning*: if the Pull Requests submitted on your repository come from a fork, you must use the event `pull_request_target` instead of `pull_request`. This will grant write permissions to `secrets.GITHUB_TOKEN`. If you use `pull_request`, the `secrets.GITHUB_TOKEN` will have read-only permissions which does not work. See [GitHub Action event pull_request_target](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target) reference.\n\n## Configuration\n\nConfigure the PR Branch Labeler action by creating a `.github/pr-branch-labeler.yml` file, e.g. with the following:\n\n```yaml\n# Apply label \"feature\" if head matches \"feature/*\"\nfeature:\n  head: \"feature/*\"\n\n# Apply label \"bugfix\" if head matches one of \"bugfix/*\" or \"hotfix/*\"\nbugfix:\n  head: [\"bugfix/*\", \"hotfix/*\"]\n```\n\nIf only a `head` is specified, you can also use the shorthand notation. The following configuration is equivalent to the one above:\n\n```yaml\nfeature: \"feature/*\"\nbugfix: [\"bugfix/*\", \"hotfix/*\"]\n```\n\nIn case you want to assign labels if the PR has a specific `base` branch, you can specify it in the configuration as follows:\n\n```yaml\n# Apply label \"release\" if base matches \"release/*\"\nrelease:\n  base: \"release/*\"\n```\n\nIf you specify both, `head` and `base`, it will be seen as an AND condition:\n\n```yaml\n# Apply label \"🧩 Subtask\" if head and base match \"feature/*\"\n🧩 Subtask:\n  head: \"feature/*\"\n  base: \"feature/*\"\n```\n\nNote: If there are multiple rules matching one branch, all of the labels will be added to the PR. One example of this would be a configuration that contains the feature and subtask rules. If a new PR with `head` and `base` matching `feature/*` will be opened, the PR gets the labels `feature` AND `🧩 Subtask`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffittschen%2Fpr-branch-labeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffittschen%2Fpr-branch-labeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffittschen%2Fpr-branch-labeler/lists"}