Skip to content

GitHub action to assign labels based on pull request change sizes

License

Notifications You must be signed in to change notification settings

yourparkingspace/size-label-action

 
 

Repository files navigation

size-label-action

GitHub action to assign labels based on pull request change sizes.

Labels are taken from https://github.com/kubernetes/kubernetes/labels?q=size

Usage

Create a .github/workflows/size-label.yml file:

name: Size Label
on: pull_request
jobs:
  size-label:
    runs-on: [self-hosted, ubuntu-latest, x64, linux]
    steps:
      - name: size-label
        uses: yourparkingspace/size-label-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Configuration

The following environment variables are supported:

  • IGNORED: A list of glob expressions separated by newlines. Files matching these expressions will not count when calculating the change size of the pull request. Lines starting with # are ignored and files matching lines starting with ! are always included.

You can configure the environment variables in the workflow file like this:

        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
          IGNORED: ".*\n!.gitignore\nyarn.lock\ngenerated/**"

License

MIT

About

GitHub action to assign labels based on pull request change sizes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.5%
  • Dockerfile 5.5%