From ecddd28472b17dfc22b4c4eb5ce69bb247210822 Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 14 Feb 2026 20:07:28 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20labeler=20configurati?= =?UTF-8?q?on=20for=20PR=20auto-labeling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces a new `.gitea/labeler.yml` file and configures a 'labeler' job to automatically apply labels to pull requests based on the changes made in the files. This enhances the efficiency of managing PRs by reducing manual intervention. --- .gitea/labeler.yml | 22 ++++++++++++++++++++++ .gitea/workflows/pr-check.yaml | 13 +++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .gitea/labeler.yml diff --git a/.gitea/labeler.yml b/.gitea/labeler.yml new file mode 100644 index 0000000..f5c868e --- /dev/null +++ b/.gitea/labeler.yml @@ -0,0 +1,22 @@ +--- +# Add 'Documentation' label to to .md files within the entire repository +# any file changes within 'docs' or 'guides' folders +Documentation: + - changed-files: + - any-glob-to-any-file: + - '**/*.md' + - docs/* + - guides/* + +# Add 'source' label to any change to src and tasks files within the source dir EXCEPT for the docs sub-folder +source: + - all: + - changed-files: + - any-glob-to-any-file: + - 'src/**/*' + - 'tasks/**/*' + - all-globs-to-all-files: '!src/docs/*' + +enhancement: + - changed-files: + - any-glob-to-any-file: '.gitea/**/*' diff --git a/.gitea/workflows/pr-check.yaml b/.gitea/workflows/pr-check.yaml index b559c00..67d3b45 100644 --- a/.gitea/workflows/pr-check.yaml +++ b/.gitea/workflows/pr-check.yaml @@ -68,6 +68,19 @@ jobs: run: | ansible-lint + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + + steps: + + - uses: actions/labeler@v6 + with: + repo-token: ${{ secrets.GITEA_TOKEN }} + configuration-path: .gitea/labeler.yml + handle_failures: runs-on: ubuntu-latest needs: [leak_test, lint_test]