Skip to content

Commit b4672ad

Browse files
committed
ENH: Add labeler workflow
Add labeler workflow so that a `GitHub` action, triggered when a PR is opened, automatically labels the PR based on the given rules. Exclude the `labeler.yaml` from the linter.
1 parent ca095ee commit b4672ad

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

.github/labeler.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Commit prefix regexes
2+
type:Compiler:
3+
title: "^COMP:.*"
4+
5+
type:Bug:
6+
title: "^BUG:.*"
7+
8+
area:Documentation:
9+
title: "^DOC:.*"
10+
11+
type:Enhancement:
12+
title: "^ENH:.*"
13+
14+
type:Performance:
15+
title: "^PERF:.*"
16+
17+
type:Style:
18+
title: "^STYLE:.*"
19+
20+
type:Coverage:
21+
title: "coverage"
22+
23+
type:Design:
24+
title: "design"
25+
26+
# Filename regexes
27+
area:Bridge:
28+
files:
29+
- "src/Bridge/*"
30+
31+
area:Core:
32+
files:
33+
- "src/Core/*"
34+
35+
area:Documentation:
36+
files:
37+
- "Documentation/*"
38+
- "Documentation.rst"
39+
40+
area:Filtering:
41+
files:
42+
- "src/Filtering/*"
43+
44+
area:IO:
45+
files:
46+
- "src/IO/*"
47+
48+
area:Numerics:
49+
files:
50+
- "src/Numerics/*"
51+
52+
area:Nonunit:
53+
files:
54+
- "src/Nonunit/*"
55+
56+
area:Registration:
57+
files:
58+
- "src/Registration/*"
59+
60+
area:Remotes:
61+
files:
62+
- "src/Remote/*"
63+
64+
area:Segmentation:
65+
files:
66+
- "src/Segmentation/*"
67+
68+
area:Video:
69+
files:
70+
- "src/Video/*"
71+
72+
language:C++:
73+
files:
74+
- "Code.cxx"
75+
76+
language:Python:
77+
files:
78+
- "Code.py"
79+
80+
type:Python notebook:
81+
files:
82+
- ".*.ipynb"
83+
84+
type:Data:
85+
files:
86+
- ".*.sha512"
87+
88+
type:Infrastructure:
89+
files:
90+
- ".binder/*"
91+
- ".github/*"
92+
- "CMake/*"
93+
- "Formatting/*"
94+
- "Superbuild/*"
95+
- "Utilities/*"
96+
- "index.rst"

.github/workflows/label-pr.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Label PRs
2+
3+
on:
4+
- pull_request_target
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: srvaroa/[email protected]
12+
env:
13+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ jobs:
2323
VALIDATE_ALL_CODEBASE: false
2424
VALIDATE_PYTHON_BLACK: true
2525
VALIDATE_YAML: true
26+
FILTER_REGEX_EXCLUDE: .github/labeler.yml
2627
DEFAULT_BRANCH: master
2728
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)