Skip to content

Commit a8274a6

Browse files
authored
Add PR labeler based on LoC (vmware-tanzu#50)
* Add PR labeler based on LoC * Update LoC label names * Move labeler as a standalone workflow triggerd by pull_request_target
1 parent 772b37a commit a8274a6

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/configs/labeler.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 1
2+
labels:
3+
- label: "size/XS"
4+
size-below: 10
5+
- label: "size/S"
6+
size-above: 9
7+
size-below: 30
8+
- label: "size/M"
9+
size-above: 29
10+
size-below: 100
11+
- label: "size/L"
12+
size-above: 99
13+
size-below: 500
14+
- label: "size/XL"
15+
size-above: 499
16+
size-below: 1000
17+
- label: "size/XXL"
18+
size-above: 999
19+
- label: "testing-needed-e2e-fast"
20+
size-above: 99

.github/workflows/labeler.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Source: https://github.com/srvaroa/labeler
13+
# Using this instead of the GH labeler action as the former supports labeling based on LoC changed.
14+
# However, it doesn't work with regex pattern to ignore generated files (CRDs, docs, etc.) in diff.
15+
# An issue has been filed https://github.com/srvaroa/labeler/issues/33 to track this improvement.
16+
- uses: srvaroa/[email protected]
17+
with:
18+
config_path: .github/configs/labeler.yml
19+
env:
20+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)