https://github.com/friendsofgo/pr-size-labeler
Sample GitHub Action written in Go to visualize and optionally limit the size of your pull requests.
https://github.com/friendsofgo/pr-size-labeler
code-review utilities
Last synced: 2 months ago
JSON representation
Sample GitHub Action written in Go to visualize and optionally limit the size of your pull requests.
- Host: GitHub
- URL: https://github.com/friendsofgo/pr-size-labeler
- Owner: friendsofgo
- License: mit
- Created: 2020-12-12T23:04:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-10T15:32:49.000Z (over 3 years ago)
- Last Synced: 2025-06-30T15:03:38.453Z (9 months ago)
- Topics: code-review, utilities
- Language: Go
- Homepage: https://github.com/marketplace/actions/prs-size-labeler
- Size: 12.7 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pull Request Size Labeler
Sample GitHub Action written in Go to visualize and optionally limit the size of your pull requests.
Developed for fun and learn.
Heavily inspired on [codelytv/pr-size-labeler](https://github.com/CodelyTV/pr-size-labeler).
**All credits for the original authors™**
[](https://github.com/friendsofgo/pr-size-labeler)
[](https://golang.org/doc/go1.15)
[](https://github.com/friendsofgo/pr-size-labeler/releases/latest)
[](https://goreportcard.com/report/github.com/friendsofgo/pr-size-labeler)
[](https://lgtm.com/projects/g/friendsofgo/pr-size-labeler/alerts/)
[](https://friendsofgo.tech)
## Usage
Create a file named `labeler.yml` inside the `.github/workflows` directory and paste:
```yml
name: labeler
on: [pull_request]
jobs:
labeler:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: friendsofgo/pr-size-labeler@v1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
xs_max_size: '10'
s_max_size: '100'
m_max_size: '500'
l_max_size: '1000'
fail_if_xl: 'false'
message_if_xl: 'This PR is so big! Please, split it 😊'
```
> If you want, you can customize all `*_max_size` with the size that fits in your project.
> By setting `fail_if_xl` to `'true'` you'll make fail all pull requests bigger than `l_max_size`.