From f41fe4dbb57ac1d26bee3e8cd16b7935cb0f21bd Mon Sep 17 00:00:00 2001 From: ITOH Date: Thu, 30 Mar 2023 21:34:38 +0200 Subject: [PATCH] ci: add automatic pr labeler (#2912) * ci: add automatic pr labeler * ci: add specific pr target types for the labeler --- .github/labeler.yml | 82 +++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 12 +++++ 2 files changed, 94 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..1ae6de53f --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,82 @@ +version: v1 + +labels: + - label: 'website' + sync: true + matcher: + files: 'website/**/*' + + - label: 'pkg-all' + matcher: + files: '*' + + - label: 'pkg-bot' + sync: true + matcher: + files: 'packages/bot/**/*' + + - label: 'pkg-client' + sync: true + matcher: + files: 'packages/client/**/*' + + - label: 'pkg-gateway' + sync: true + matcher: + files: 'packages/gateway/**/*' + + - label: 'pkg-rest' + sync: true + matcher: + files: 'packages/rest/**/*' + + - label: 'pkg-types' + sync: true + matcher: + files: 'packages/types/**/*' + + - label: 'pkg-utils' + sync: true + matcher: + files: 'packages/utils/**/*' + + - label: 't-breaking' + matcher: + title: "^[a-z]+(\\(.+\\))?!: .*" + + - label: 't-build' + matcher: + title: "^build(\\(.+\\))?!?: .*" + + - label: 't-ci' + matcher: + files: '.github/workflows/*' + title: '^ci: .*' + + - label: 't-docs' + matcher: + title: "^docs(\\(.+\\))?!?: .*" + + - label: 't-feat' + matcher: + title: "^feat(\\(.+\\))?!?: .*" + + - label: 't-fix' + matcher: + title: "^fix(\\(.+\\))?!?: .*" + + - label: 't-perf' + matcher: + title: "^perf(\\(.+\\))?!?: .*" + + - label: 't-refactor' + matcher: + title: "^refactor(\\(.+\\))?!?: .*" + + - label: 't-style' + matcher: + title: "^refactor(\\(.+\\))?!?: .*" + + - label: 't-test' + matcher: + title: "^test(\\(.+\\))?!?: .*" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 000000000..da9e497c4 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,12 @@ +on: + pull_request_target: + types: ['edited', 'opened', 'reopened', 'synchronize'] + +jobs: + labeler: + name: Labeler + runs-on: ubuntu-latest + steps: + - uses: fuxingloh/multi-labeler@v2 + with: + github-token: ${{secrets.GITHUB_TOKEN}}