https://github.com/julienkode/team-labeler-action
⚡️ Github action to label your pull requests based on the author name ⚡️
https://github.com/julienkode/team-labeler-action
actions github github-actions javascript labeler-action pull-request teams typescript workflow
Last synced: 2 days ago
JSON representation
⚡️ Github action to label your pull requests based on the author name ⚡️
- Host: GitHub
- URL: https://github.com/julienkode/team-labeler-action
- Owner: JulienKode
- License: apache-2.0
- Created: 2019-12-29T15:24:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2026-05-09T09:21:56.000Z (24 days ago)
- Last Synced: 2026-05-24T18:05:07.950Z (8 days ago)
- Topics: actions, github, github-actions, javascript, labeler-action, pull-request, teams, typescript, workflow
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/team-labeler-action
- Size: 115 MB
- Stars: 50
- Watchers: 1
- Forks: 44
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Team Labeler Action 👥
[](https://github.com/JulienKode/team-labeler-action/actions)
[](https://github.com/JulienKode/team-labeler-action/actions)
[](https://github.com/JulienKode/team-labeler-action/issues)
[](https://github.com/JulienKode/team-labeler-action/network)
[](https://github.com/JulienKode/team-labeler-action/stargazers)
[](https://github.com/JulienKode/team-labeler-action/blob/master/LICENSE)
[](https://github.com/JulienKode/team-labeler-action/watchers)
[](https://twitter.com/intent/tweet?text=Checkout%20this%20library%20https%3A%2F%2Fgithub.com%2FJulienKode%2Fteam-labeler-action)
This repository provides a **GitHub action** to automatically **team label** on a **pull request** based author team.
This is useful if multiple team are working on the same project.

## Configuration
### Create `.github/teams.yml`
You need to provide a yml file that contains members of your teams:
```yaml
LightSide:
- '@Yoda'
- '@Luke'
DarkSide:
- '@DarkVador'
- '@Palpatine'
```
### GitHub Team Support
You can also use GitHub team names to automatically apply labels based on team membership. To do this:
Include team names in your configuration using the format `@organization/team-slug`:
```yaml
FrontendTeam:
- '@YourOrg/frontend'
BackendTeam:
- '@YourOrg/backend'
```
## Usage
### Create `.github/workflows/team-labeler.yml`
Create a workflow (eg: `.github/workflows/team-labeler.yml` see [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)) to utilize the labeler action.
This action only needs the GITHUB_TOKEN secret as it interacts with the GitHub API to modify labels. It's working for pull request and issues. The action can be used as such:
```yaml
on:
pull_request:
issues:
name: team-label
permissions:
contents: read
pull-requests: write
issues: write # Necessary to create the labels if they do not exist yet.
jobs:
team-labeler:
runs-on: ubuntu-latest
steps:
- uses: JulienKode/team-labeler-action@v3.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# Optional: Add if you want to use GitHub team-based labeling
org-token: "${{ secrets.ORG_TOKEN }}"
```
## Required Permissions
1. **For basic functionality**, the workflow needs:
- `contents: read`
- `pull-requests: write` (to apply labels to pull requests)
- `issues: write` (to apply labels to issues and create labels if they do not exist yet)
2. **For GitHub team integration**, you need to:
- Create a Personal Access Token with `read:org` permission
- Add this token as a repository secret (e.g., `ORG_TOKEN`)
- Pass this token to the action using the `org-token` parameter
> Note: While the `issues:write` permission does allow for creating labels through GitHub's API.