From 7bf6a627946db4cc97a477f8d44d2cc8e2c8b9ab Mon Sep 17 00:00:00 2001 From: Suhani Date: Thu, 14 May 2026 22:59:46 +0530 Subject: [PATCH] feat: add automated PR labeling system --- .github/labels.yml | 71 +++++++++++++++++++++++++++++ .github/workflows/pr-labelling.yaml | 26 +++++++++++ 2 files changed, 97 insertions(+) create mode 100644 .github/labels.yml create mode 100644 .github/workflows/pr-labelling.yaml diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 000000000..8fc6cba0a --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,71 @@ +documentation: + - changed-files: + - any-glob-to-any-file: + - 'src/content/docs/**/*.{md,mdx}' + - 'src/content/policies/**/*.md' + - 'content/**/*.md' + - 'README.md' + - 'CONTRIBUTING.md' + - 'DEVELOPMENT.md' + - 'OWNERS.md' + +blog: + - changed-files: + - any-glob-to-any-file: + - 'src/content/blog/**/*' + +website-redesign: + - changed-files: + - any-glob-to-any-file: + - 'src/components/**/*.{astro,css,js,jsx,ts,tsx}' + - 'src/layouts/**/*.astro' + - 'src/sections/**/*.{astro,css,js,jsx,ts,tsx}' + - 'src/styles/**/*.css' + - 'public/assets/**/*' + +github_actions: + - changed-files: + - any-glob-to-any-file: + - '.github/workflows/**/*.{yml,yaml}' + - '.github/actions/**/*.{yml,yaml}' + +dependencies: + - changed-files: + - any-glob-to-any-file: + - 'package.json' + - 'package-lock.json' + - '.github/dependabot.yml' + +config: + - changed-files: + - any-glob-to-any-file: + - 'astro.config.mjs' + - 'markdoc.config.mjs' + - 'src/content.config.ts' + - 'netlify.toml' + - 'tsconfig.json' + - 'lychee.toml' + +javascript: + - changed-files: + - any-glob-to-any-file: + - 'src/constants/**/*.{js,ts}' + - 'src/hooks/**/*.{js,jsx,ts,tsx}' + - 'src/utils/**/*.{js,ts}' + - 'scripts/**/*.{js,ts,mjs,cjs}' + +go: + - changed-files: + - any-glob-to-any-file: + - '**/*.go' + - 'go.mod' + - 'go.sum' + +webhook: + - changed-files: + - any-glob-to-any-file: + - 'src/content/docs/**/admission-controllers.md' + - 'src/content/docs/**/validating-policy.mdx' + - 'src/content/docs/**/mutating-policy.mdx' + - 'src/content/docs/**/image-validating-policy.mdx' + - 'src/content/policies/**/admission-webhooks/**/*' diff --git a/.github/workflows/pr-labelling.yaml b/.github/workflows/pr-labelling.yaml new file mode 100644 index 000000000..9d541892c --- /dev/null +++ b/.github/workflows/pr-labelling.yaml @@ -0,0 +1,26 @@ +name: PR Labeler + +on: + pull_request: + types: + - opened + - reopened + - synchronize + +permissions: + contents: read + pull-requests: write + +jobs: + label: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.1 + + - name: Apply labels + uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: '.github/labels.yml' + sync-labels: true