Giter VIP home page Giter VIP logo

pull-request-labeler's Introduction

Pull request size labeler ๐Ÿ“

Github action to measure and level the size of pull request, this could be util for follow team conventions when we all agree on to not open pull request with more than X number of modifications.

โ„น๏ธ The modifications are calculated based on the number of additions + number of deletions

Configuration

The pull request sizes are configurable, currently it allows 4 sizes:

  • XS extra small
  • SM small
  • MD medium
  • LG large
  • XL extra large

In your workflows folder create a worflow file e.g. labeler.yml and inside this file add this:

name: Labeler

on: [pull_request]

jobs:
  size-labeler:
    runs-on: ubuntu-latest
    name: 'Label the PR'
    steps:
      - name: Pull request size labelling
        uses: alexromer0/[email protected]
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          xs_limit: '50'
          sm_limit: '100'
          md_limit: '300'
          lg_limit: '600'

Feel free to adjust the size limits to your needs

Dealing with dependabot

If you have enable dependabot in your repo it might be that the "basic" configuration for this action fail whenever dependabot creates a pull request. This might be related to the fact that when dependabot creates a PR it does as read only more info here. Anyways the suggested solution is to change the event type in your action file and use pull_request_target so your action file should look like this

name: Labeler

on: [pull_request_target]

jobs:
  size-labeler:
    runs-on: ubuntu-latest
    name: 'Label the PR'
    steps:
      - name: Pull request size labelling
        uses: alexromer0/[email protected]
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          xs_limit: '50'
          sm_limit: '100'
          md_limit: '300'
          lg_limit: '600'

pull-request-labeler's People

Contributors

alexromer0 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.