GithubHelp home page GithubHelp logo

typeddevs / pr-size-labeler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codelytv/pr-size-labeler

0.0 0.0 0.0 53 KB

๐Ÿท Visualize and optionally limit the size of your Pull Requests

Home Page: https://github.com/marketplace/actions/pull-request-size-labeler

License: MIT License

Shell 94.72% Dockerfile 5.28%

pr-size-labeler's Introduction

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'
          files_to_ignore: ''

๐ŸŽ›๏ธ 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
  • message_if_xl: Let the user(s) know that the PR exceeds the recommended size and what the consequences are
  • github_api_url: Override this parameter in order to use with your own GitHub Enterprise Server. Example: 'https://github.example.com/api/v3'
  • files_to_ignore: Whitespace or newline separated list of files to ignore when calculating the PR size, regex match is supported.

files_to_ignore Example:

files_to_ignore: 'package-lock.json *.lock'
# OR
files_to_ignore: |
  "package-lock.json"
  "*.lock"
  "docs/*"

๐Ÿค” 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

pr-size-labeler's People

Contributors

rgomezcasas avatar khru avatar javiercane avatar chemaclass avatar bhean avatar bflad avatar wu-cl avatar mambax avatar mikybars avatar rjlopezdev avatar antonio-gg-dev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.