From 3f248598ba9ea60bc0aa77f9906752584361f85a Mon Sep 17 00:00:00 2001 From: Jon Cahill-Torre Date: Tue, 11 Mar 2025 13:36:06 +0000 Subject: [PATCH 1/3] feat: add labeler action --- .github/labeler.yml | 112 ++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 18 ++++++ 2 files changed, 130 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..a86be4e11 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,112 @@ +# Label PRs based on modified file paths (v5 format) +# https://github.com/actions/labeler + +# General documentation + +documentation: + - changed-files: + - any-glob-to-any-file: + - 'content/**' + - 'assets/**' + - 'static/**' + - 'data/**' + +# Product labels + +product/agent: + - changed-files: + - any-glob-to-any-file: + - 'content/agent/**' + - 'content/includes/agent/**' + +product/amplify: + - changed-files: + - any-glob-to-any-file: 'content/amplify/**' + +product/controller: + - changed-files: + - any-glob-to-any-file: + - 'content/controller/**' + - 'content/includes/controller/**' + +product/mesh: + - changed-files: + - any-glob-to-any-file: 'content/mesh/**' + +product/modsec-waf: + - changed-files: + - any-glob-to-any-file: 'content/modsec-waf/**' + +product/nap-dos: + - changed-files: + - any-glob-to-any-file: 'content/nap-dos/**' + +product/nap-waf: + - changed-files: + - any-glob-to-any-file: + - 'content/nap-waf/**' + - 'content/includes/nap-waf/**' + +product/ngf: + - changed-files: + - any-glob-to-any-file: + - 'content/ngf/**' + - 'content/includes/ngf/**' + +product/nginx-plus: + - changed-files: + - any-glob-to-any-file: + - 'content/nginx/**' + - 'content/includes/nginx-plus/**' + +product/nginx-one: + - changed-files: + - any-glob-to-any-file: 'content/nginx/**' + +product/nginxaas: + - changed-files: + - any-glob-to-any-file: + - 'content/nginxaas-azure/**' + - 'content/includes/nginxaas-azure/**' + +product/nim: + - changed-files: + - any-glob-to-any-file: + - 'content/nim/**' + - 'content/includes/nim/**' + +product/nms: + - changed-files: + - any-glob-to-any-file: + - 'content/nms/**' + - 'content/includes/nms/**' + +# Other labels + +process documentation: + - changed-files: + - any-glob-to-any-file: + - 'templates/**' + - '*.md' + - 'LICENSE' + +tooling: + - changed-files: + - any-glob-to-any-file: + - 'layouts/**' + - '.github/**' + - '.cloudcannon/**' + - 'styles/**' + - 'layouts/**' + - 'config/**' + - 'archetypes/**' + - '*.yml' + - '*.yaml' + - '*.json' + - '*.ts' + - '*.sh' + - '*.js' + - 'Makefile' + - '.vale.ini' + - '.gitignore' + - '.gitattributes' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 000000000..667025ada --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,18 @@ +name: PR Labeler + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read # Required to read the labeler.yml file + pull-requests: write # Required to apply labels to PRs + +jobs: + label: + runs-on: ubuntu-latest + steps: + - name: Apply labels based on file paths + uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" From 4515b66556a996c7fda49971a143edd06e3d83ae Mon Sep 17 00:00:00 2001 From: Jon Cahill-Torre Date: Tue, 11 Mar 2025 14:19:54 +0000 Subject: [PATCH 2/3] fix: fix nginx-one path --- .github/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index a86be4e11..d56e0b595 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -61,7 +61,7 @@ product/nginx-plus: product/nginx-one: - changed-files: - - any-glob-to-any-file: 'content/nginx/**' + - any-glob-to-any-file: 'content/nginx-one/**' product/nginxaas: - changed-files: From 6009d9c85f663876c010935bc93d5bbcf48dd06f Mon Sep 17 00:00:00 2001 From: Jon Cahill-Torre Date: Tue, 11 Mar 2025 14:24:39 +0000 Subject: [PATCH 3/3] feat: add filters for Unit and potential include paths --- .github/labeler.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index d56e0b595..1887bf358 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -39,7 +39,9 @@ product/modsec-waf: product/nap-dos: - changed-files: - - any-glob-to-any-file: 'content/nap-dos/**' + - any-glob-to-any-file: + - 'content/nap-dos/**' + - 'content/includes/nap-dos/**' product/nap-waf: - changed-files: @@ -61,7 +63,9 @@ product/nginx-plus: product/nginx-one: - changed-files: - - any-glob-to-any-file: 'content/nginx-one/**' + - any-glob-to-any-file: + - 'content/nginx-one/**' + - 'content/includes/nginx-one/**' product/nginxaas: - changed-files: @@ -81,6 +85,12 @@ product/nms: - 'content/nms/**' - 'content/includes/nms/**' +product/unit: + - changed-files: + - any-glob-to-any-file: + - 'content/unit/**' + - 'content/includes/unit/**' + # Other labels process documentation: