CodelyTV / pr-size-labeler

šŸ· Visualize and optionally limit the size of your Pull Requests
https://github.com/marketplace/actions/pull-request-size-labeler
MIT License
343 stars 61 forks source link

Size Label Customization #25

Closed bflad closed 3 years ago

bflad commented 3 years ago

Description

Hi there! šŸ‘‹ We would love the ability to customize the size labels that get applied. In our use case, it is to match previously existing capitalized labels (e.g. size/XS) and associated workflows with those.

Proposal

Add new configuration options with defaults matching the existing label names:

inputs:
  # ...
  xs_label:
    description: 'Label for xs PR'
    required: false
    default: 'size/xs'
  s_label:
    description: 'Label for s PR'
    required: false
    default: 'size/s'
  m_label:
    description: 'Label for m PR'
    required: false
    default: 'size/m'
  l_label:
    description: 'Label for l PR'
    required: false
    default: 'size/l'
# ...
runs:
  using: 'docker'
  image: 'Dockerfile'
  args:
    - ${{ inputs.GITHUB_TOKEN }}
    - ${{ inputs.xs_label }}
    - ${{ inputs.xs_max_size }}
    - ${{ inputs.s_label }}
    - ${{ inputs.s_max_size }}
    - ${{ inputs.m_label }}
    - ${{ inputs.m_max_size }}
    - ${{ inputs.l_label }}
    - ${{ inputs.l_max_size }}
    - ${{ inputs.fail_if_xl }}
    - ${{ inputs.message_if_xl }}
    - ${{ inputs.github_api_url }}

And adjusting hardcoded size/ references in the code.