🏷 Visualize and optionally limit the size of your Pull Requests
Find a file
Brian Flad 2b4112ffb7
feat: support size label customization (#26)
* Support size label customization

Reference: https://github.com/CodelyTV/pr-size-labeler/issues/25

* Use curly braces with positional arguments

Prevents issues with $10 and higher.
2021-09-20 11:30:23 +02:00
.github/workflows More explicit and self-explanatory message_if_xl default parameter value 2021-03-04 12:08:58 +01:00
src feat: support size label customization (#26) 2021-09-20 11:30:23 +02:00
action.yml feat: support size label customization (#26) 2021-09-20 11:30:23 +02:00
Dockerfile Use arithmetic operators built in Bash (#6) 2020-03-08 20:41:17 +01:00
entrypoint.sh feat: support size label customization (#26) 2021-09-20 11:30:23 +02:00
LICENSE Use MIT license 2020-03-03 10:00:17 +01:00
README.md feat: support size label customization (#26) 2021-09-20 11:30:23 +02:00

CodelyTV logo

🏷 Pull Request size labeler

codely.tv CodelyTV Courses GitHub Action version

Visualize and optionally limit the size of your Pull Requests

🚀 Usage

Create a file named labeler.yml inside the .github/workflows directory and paste the following configuration.

☝️ Here you can see the default values of all available configuration parameters, however, the only required parameter is the GITHUB_TOKEN one.

name: labeler

on: [pull_request]

jobs:
  labeler:
    runs-on: ubuntu-latest
    name: Label the PR size
    steps:
      - uses: codelytv/pr-size-labeler@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          xs_label: 'size/xs'
          xs_max_size: '10'
          s_label: 'size/s'
          s_max_size: '100'
          m_label: 'size/m'
          m_max_size: '500'
          l_label: 'size/l'
          l_max_size: '1000'
          xl_label: 'size/xl'
          fail_if_xl: 'false'
          message_if_xl: >
            'This PR exceeds the recommended size of 1000 lines.
            Please make sure you are NOT addressing multiple issues with one PR.
            Note this PR might be rejected due to its size.
          github_api_url: 'api.github.com'

🎛️ Available parameters

  • *_label (xs_label, s_label…): Adjust size label names
  • *_max_size (xs_max_size, s_max_size…): Adjust which amount of changes you consider appropriate for each size based on your project context
  • fail_if_xl: Set to 'true' will report GitHub Workflow failure if the PR size is xl allowing to forbid PR merge
  • github_api_url: Override this parameter in order to use with your own GitHub Enterprise Server. Example: 'github.example.com/api/v3'

🤔 Basic concepts or assumptions

  • PR size labeler consider as a change any kind of line addition, deletion, or modification
  • A PR will be labeled as xl if it exceeds the amount of changes defined as l_max_size

⚖️ License

MIT