https://github.com/koozz/gh-teamlabel
Label a pull request with the team name of the author.
https://github.com/koozz/gh-teamlabel
gh-cli gh-extension
Last synced: 3 months ago
JSON representation
Label a pull request with the team name of the author.
- Host: GitHub
- URL: https://github.com/koozz/gh-teamlabel
- Owner: koozz
- License: mit
- Created: 2022-05-27T10:58:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T04:34:23.000Z (over 1 year ago)
- Last Synced: 2024-11-20T14:23:39.579Z (about 1 year ago)
- Topics: gh-cli, gh-extension
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gh-teamlabel
This GitHub CLI extension can be used to label a pull request with team names
that the author of the pull request is part of.
[](https://lgtm.com/projects/g/koozz/gh-teamlabel/alerts/)
[](https://lgtm.com/projects/g/koozz/gh-teamlabel/context:go)
## Usage
From the commandline:
```bash
gh extension install koozz/gh-teamlabel # Just once
gh teamlabel -org my-org team1_slug:Team1Label team2_slug:Team2Label
```
In GitHub Actions, add a step like this:
```yaml
- name: Team labeling
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install koozz/gh-teamlabel --pin 2.0.3
gh teamlabel -org my-org team1_slug:Team1Label team2_slug:Team2Label
```
### Caveat
The used GitHub token must have enough privileges, either use a GitHub App or a Personal Access Token.
## Adding labels
Adding labels on a pull request only works if these labels have been added to
the repository.
You could prepend the above scripts with calls to [gh label create](https://cli.github.com/manual/gh_label_create)
```bash
gh label create Team1Label --color 336699 --description "Team one label description" --force
gh label create Team2Label --color 336699 --description "Team two label description" --force
gh teamlabel -org my-org team1:Team1Label team2:Team2Label
```
## License
MIT