2020-02-27 18:32:31 +01:00
|
|
|
<p align="center">
|
|
|
|
<a href="http://codely.tv">
|
|
|
|
<img src="http://codely.tv/wp-content/uploads/2016/05/cropped-logo-codelyTV.png" width="192px" height="192px"/>
|
|
|
|
</a>
|
|
|
|
</p>
|
2020-02-27 17:08:37 +01:00
|
|
|
|
2020-02-27 18:32:31 +01:00
|
|
|
<h1 align="center">
|
|
|
|
🏷 Pull Request size labeler
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
<a href="https://github.com/CodelyTV"><img src="https://img.shields.io/badge/CodelyTV-OS-green.svg?style=flat-square" alt="codely.tv"/></a>
|
|
|
|
<a href="http://pro.codely.tv"><img src="https://img.shields.io/badge/CodelyTV-PRO-black.svg?style=flat-square" alt="CodelyTV Courses"/></a>
|
2020-03-02 08:59:03 +01:00
|
|
|
<a href="https://github.com/marketplace/actions/pull-request-size-labeler"><img src="https://img.shields.io/github/v/release/CodelyTV/pr-size-labeler?style=flat-square" alt="GitHub Action version"></a>
|
2020-02-27 18:32:31 +01:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
Visualize and optionally limit the size of your Pull Requests
|
|
|
|
</p>
|
|
|
|
|
|
|
|
## 🚀 Usage
|
|
|
|
|
2020-03-02 08:57:38 +01:00
|
|
|
Create a file named `labeler.yml` inside the `.github/workflows` directory and paste:
|
2020-02-27 18:32:31 +01:00
|
|
|
|
|
|
|
```yml
|
|
|
|
name: labeler
|
|
|
|
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
labeler:
|
|
|
|
runs-on: ubuntu-latest
|
2020-02-27 18:48:35 +01:00
|
|
|
name: Label the PR size
|
2020-02-27 18:32:31 +01:00
|
|
|
steps:
|
|
|
|
- uses: codelytv/pr-size-labeler@v1
|
|
|
|
with:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-03-04 14:21:23 +01:00
|
|
|
xs_max_size: '10'
|
2020-02-27 18:32:31 +01:00
|
|
|
s_max_size: '100'
|
2020-03-04 14:21:23 +01:00
|
|
|
m_max_size: '500'
|
|
|
|
l_max_size: '1000'
|
|
|
|
fail_if_xl: 'false'
|
2020-05-05 13:58:09 +02:00
|
|
|
message_if_xl: 'This PR is so big! Please, split it 😊'
|
2020-02-27 17:08:37 +01:00
|
|
|
```
|
2020-02-27 18:32:31 +01:00
|
|
|
|
2020-03-04 14:21:23 +01:00
|
|
|
> If you want, you can customize all `*_max_size` with the size that fits in your project.
|
|
|
|
|
|
|
|
> Setting `fail_if_xl` to `'true'` will make fail all pull requests bigger than `l_max_size`.
|
|
|
|
|
2021-03-03 12:54:34 +01:00
|
|
|
### Github Enterprise Server
|
|
|
|
|
|
|
|
You can override the public Github API by setting `github_api_url`.
|
|
|
|
|
|
|
|
```yml
|
|
|
|
- uses: codelytv/pr-size-labeler@v1
|
|
|
|
with:
|
|
|
|
...
|
|
|
|
github_api_url: 'github.mycompany.net/api/v3'
|
|
|
|
```
|
|
|
|
|
2020-02-27 18:32:31 +01:00
|
|
|
## ⚖️ License
|
|
|
|
|
|
|
|
[MIT](LICENSE)
|