From 3839702e88a2a5b1f62262836e7c3a98cf0d08fa Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 4 Jul 2024 07:25:34 +0200 Subject: [PATCH] ci: added labeler & pr title validation --- .github/labeler.yml | 28 ++++++++++++++++++++++++ .github/workflows/labeler.yml | 12 ++++++++++ .github/workflows/pr.yml | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/pr.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..e5efb482 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,28 @@ +core: + - all: + - changed-files: + - any-glob-to-any-file: "lua/tokyonight/**" + - all-globs-to-all-files: + - "!lua/tokyonight/groups/**" + - "!lua/tokyonight/colors/**" + - "!lua/tokyonight/extra/**" + +extras: + - changed-files: + - any-glob-to-any-file: "lua/tokyonight/extra/**" + +groups: + - changed-files: + - any-glob-to-any-file: "lua/tokyonight/groups/**" + +base: + - changed-files: + - any-glob-to-any-file: + - "lua/tokyonight/groups/base.lua" + - "lua/tokyonight/groups/kinds.lua" + - "lua/tokyonight/groups/treesitter.lua" + - "lua/tokyonight/groups/semantic_tokens.lua" + +colors: + - changed-files: + - any-glob-to-any-file: "lua/tokyonight/colors/**" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..52474c6a --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,12 @@ +name: "Pull Request Labeler" +on: + - pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..0401a4d8 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,41 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + requireScope: true + subjectPattern: ^(?![A-Z]).+$ + scopes: | + .+ + types: | + build + chore + ci + docs + feat + fix + merge + perf + refactor + revert + style + test + wip + ignoreLabels: | + autorelease: pending