diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 713e8bc36..f84cdf3c9 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -40,6 +40,9 @@ jobs: - name: Create labels run: poetry run python scripts/set_up_labeler.py + - name: Show labeler config + run: cat .github/labeler.yml + - uses: actions/labeler@v6 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index c28e24853..8336f9755 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ __pycache__/ venv/ generated/ +# Generate labels +.github/labeler.yml + # Object directory obj/ diff --git a/scripts/set_up_labeler.py b/scripts/set_up_labeler.py index 7c861f6f9..2746f7055 100644 --- a/scripts/set_up_labeler.py +++ b/scripts/set_up_labeler.py @@ -33,18 +33,30 @@ def get_labeler_config(projects: list[str]) -> dict[str, Any]: config: dict[str, Any] = { # Not just language READMEs "enhancement": [ - {"changed-files": [{"all-globs-to-all-files": ["**"]}]}, - {"base-branch": "main"}, + { + "all": [ + {"changed-files": [{"all-globs-to-all-files": ["**"]}]}, + {"base-branch": "main"}, + ] + }, ], # README.md and any Markdown file in .github directory "needs docs": [ - {"changed-files": [{"any-glob-to-any-file": ["README.md", ".github/*.md"]}]}, - {"base-branch": "main"}, + { + "all": [ + {"changed-files": [{"any-glob-to-any-file": ["README.md", ".github/*.md"]}]}, + {"base-branch": "main"}, + ] + } ], # Any language testinfo.yml files "tests": [ - {"changed-files": [{"any-glob-to-any-file": ["archive/*/*/testinfo.yml"]}]}, - {"base-branch": "main"}, + { + "all": [ + {"changed-files": [{"any-glob-to-any-file": ["archive/*/*/testinfo.yml"]}]}, + {"base-branch": "main"}, + ] + }, ], } @@ -56,17 +68,21 @@ def get_labeler_config(projects: list[str]) -> dict[str, Any]: ) config[project] = [ { - "changed-files": [ + "all": [ { - "any-glob-to-any-file": [ - f"archive/*/*/{filename}.*" for filename in filenames + "changed-files": [ + { + "any-glob-to-any-file": [ + f"archive/*/*/{filename}.*" for filename in filenames + ] + } ] - } + }, + { + "base-branch": "main", + }, ] - }, - { - "base-branch": "main", - }, + } ] return config