Skip to content

Commit

Permalink
Add PR labeler based on LoC (#50)
Browse files Browse the repository at this point in the history
* Add PR labeler based on LoC

* Update LoC label names

* Move labeler as a standalone workflow triggerd by pull_request_target
  • Loading branch information
dilyar85 committed Jan 30, 2023
1 parent 772b37a commit a8274a6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/configs/labeler.yml
@@ -0,0 +1,20 @@
version: 1
labels:
- label: "size/XS"
size-below: 10
- label: "size/S"
size-above: 9
size-below: 30
- label: "size/M"
size-above: 29
size-below: 100
- label: "size/L"
size-above: 99
size-below: 500
- label: "size/XL"
size-above: 499
size-below: 1000
- label: "size/XXL"
size-above: 999
- label: "testing-needed-e2e-fast"
size-above: 99
20 changes: 20 additions & 0 deletions .github/workflows/labeler.yml
@@ -0,0 +1,20 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
# Source: https://github.com/srvaroa/labeler
# Using this instead of the GH labeler action as the former supports labeling based on LoC changed.
# However, it doesn't work with regex pattern to ignore generated files (CRDs, docs, etc.) in diff.
# An issue has been filed https://github.com/srvaroa/labeler/issues/33 to track this improvement.
- uses: srvaroa/labeler@v0.9
with:
config_path: .github/configs/labeler.yml
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit a8274a6

Please sign in to comment.