Skip to content

Commit e6d123f

Browse files
authored
Fix labeler script (#5271)
1 parent 894e92c commit e6d123f

File tree

3 files changed

+36
-14
lines changed

3 files changed

+36
-14
lines changed

.github/workflows/pr-labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
- name: Create labels
4141
run: poetry run python scripts/set_up_labeler.py
4242

43+
- name: Show labeler config
44+
run: cat .github/labeler.yml
45+
4346
- uses: actions/labeler@v6
4447
with:
4548
repo-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ __pycache__/
1212
venv/
1313
generated/
1414

15+
# Generate labels
16+
.github/labeler.yml
17+
1518
# Object directory
1619
obj/
1720

scripts/set_up_labeler.py

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,30 @@ def get_labeler_config(projects: list[str]) -> dict[str, Any]:
3333
config: dict[str, Any] = {
3434
# Not just language READMEs
3535
"enhancement": [
36-
{"changed-files": [{"all-globs-to-all-files": ["**"]}]},
37-
{"base-branch": "main"},
36+
{
37+
"all": [
38+
{"changed-files": [{"all-globs-to-all-files": ["**"]}]},
39+
{"base-branch": "main"},
40+
]
41+
},
3842
],
3943
# README.md and any Markdown file in .github directory
4044
"needs docs": [
41-
{"changed-files": [{"any-glob-to-any-file": ["README.md", ".github/*.md"]}]},
42-
{"base-branch": "main"},
45+
{
46+
"all": [
47+
{"changed-files": [{"any-glob-to-any-file": ["README.md", ".github/*.md"]}]},
48+
{"base-branch": "main"},
49+
]
50+
}
4351
],
4452
# Any language testinfo.yml files
4553
"tests": [
46-
{"changed-files": [{"any-glob-to-any-file": ["archive/*/*/testinfo.yml"]}]},
47-
{"base-branch": "main"},
54+
{
55+
"all": [
56+
{"changed-files": [{"any-glob-to-any-file": ["archive/*/*/testinfo.yml"]}]},
57+
{"base-branch": "main"},
58+
]
59+
},
4860
],
4961
}
5062

@@ -56,17 +68,21 @@ def get_labeler_config(projects: list[str]) -> dict[str, Any]:
5668
)
5769
config[project] = [
5870
{
59-
"changed-files": [
71+
"all": [
6072
{
61-
"any-glob-to-any-file": [
62-
f"archive/*/*/{filename}.*" for filename in filenames
73+
"changed-files": [
74+
{
75+
"any-glob-to-any-file": [
76+
f"archive/*/*/{filename}.*" for filename in filenames
77+
]
78+
}
6379
]
64-
}
80+
},
81+
{
82+
"base-branch": "main",
83+
},
6584
]
66-
},
67-
{
68-
"base-branch": "main",
69-
},
85+
}
7086
]
7187

7288
return config

0 commit comments

Comments
 (0)